如何使用OpenSSL创建自签名证书

时光怂恿深爱的人放手 提交于 2020-08-15 21:43:39

问题:

I'm adding HTTPS support to an embedded Linux device. 我正在向嵌入式Linux设备添加HTTPS支持。 I have tried to generate a self-signed certificate with these steps: 我尝试通过以下步骤生成自签名证书:

openssl req -new > cert.csr
openssl rsa -in privkey.pem -out key.pem
openssl x509 -in cert.csr -out cert.pem -req -signkey key.pem -days 1001
cat key.pem>>cert.pem

This works, but I get some errors with, for example, Google Chrome: 这可行,但是我遇到了一些错误,例如Google Chrome:

This is probably not the site you are looking for! 这可能不是您要查找的网站!
The site's security certificate is not trusted! 该站点的安全证书不受信任!

Am I missing something? 我想念什么吗? Is this the correct way to build a self-signed certificate? 这是构建自签名证书的正确方法吗?


解决方案:

参考一: https://stackoom.com/question/ghC0/如何使用OpenSSL创建自签名证书
参考二: https://oldbug.net/q/ghC0/How-to-create-a-self-signed-certificate-with-OpenSSL
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!