[network]OpenSSL生成证书的步骤
SSL的原理先不说,这里先把证书的生成以及CA的生成和签名记录一下:1.1.服务端密钥
openssl genrsa -des3 -out server.key 2048
PEM pass phrase:123456
1.2.密钥去密码
openssl rsa -in server.key -out server.key [cancel password]
pass phrase:123456 [ca password]
1.3.生成请求签名文件
openssl req -new -key server.key -out server.csr
2.1.客户端密钥
openssl genrsa -des3 -out client.key 2048
PEM pass phrase:123456
2.2.密钥去密码
openssl rsa -in client.key -out client.key [cancel password]
pass phrase:123456 [ca password]
2.3.生成请求签名文件
openssl req -new -key client.key -out client.csr
3.1.生成CA密钥
openssl genrsa -des3 -out ca.key 2048
PEM pass phrase:123456
3.2.密钥去密码
openssl rsa -in ca.key -out ca.key [cancel password]
pass phrase:123456 [ca password]
3.3.生成证书
openssl req -new -x509 -key ca.key -out ca.crt
4.1.一个脚本,作用没深究
/usr/lib/ssl/misc/CA.pl -newca
:ca.crt
4.2.由CA签名证书
openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config openssl.cnf
openssl ca -in client.csr -out client.crt -cert ca.crt -keyfile ca.key -config openssl.cnf
标签: network
评论:
日历
最新微语
- 有的时候,会站在分叉路口,不知道向左还是右
2023-12-26 15:34
- 繁花乱开,鸟雀逐风。心自宁静,纷扰不闻。
2023-03-14 09:56
- 对于不可控的事,我们保持乐观,对于可控的事情,我们保持谨慎。
2023-02-09 11:03
- 小时候,
暑假意味着无忧无虑地玩很长一段时间,
节假意味着好吃好喝还有很多长期不见的小朋友来玩...
长大后,
这是女儿第一个暑假,
一个半月...
2022-07-11 08:54
- Watching the autumn leaves falling as you grow older together
2018-10-25 09:45
分类
最新评论
- Goonog
i get it now :) - 萧
@Fluzak:The web host... - Fluzak
Nice blog here! Also... - Albertarive
In my opinion you co... - ChesterHep
What does it plan? - ChesterHep
No, opposite. - mojoheadz
Everything is OK!... - Josephmaigh
I just want to say t... - ChesterHep
What good topic - AnthonyBub
Certainly, never it ...
2016-03-30 09:52
./mosquitto_pub -h 192.168.0.106 -p 8883 -t "111" -m "this is nicholas pub" --cafile /home/nicholas/workspace/project/mosquitto/run/openssl/ca.crt --cert /home/nicholas/workspace/project/mosquitto/run/openssl/client.crt --key /home/nicholas/workspace/project/mosquitto/run/openssl/client.key