快速创建ssl 的key

本文可自由转载,但请遵循“署名-非商业用途-保持一致”的创作共用协议。 永久链接:JoeCen's 小猫窝
-----------------------------

这段时间经常要重建apche,每次都忘记openssl的命令要去查,干脆就把命令写在自己的blog上面。
debian的命令现在已经没有了,需要使用openssl命令去创建apache 的sll key:

1、建立key:

openssl genrsa -out server.key 1024

2、建立csr:

openssl req -new -key server.key -out server.csr
  1. You are about to be asked to enter information that will be incorporated
  2. into your certificate request.
  3. What you are about to enter is what is called a Distinguished Name or a DN.
  4. There are quite a few fields but you can leave some blank
  5. For some fields there will be a default value,
  6. If you enter '.', the field will be left blank.
  7. -----
  8. Country Name (2 letter code) [AU]:CN
  9. State or Province Name (full name) [Some-State]:GD
  10. Locality Name (eg, city) []:GZ
  11. Organization Name (eg, company) [Internet Widgits Pty Ltd]:公司名
  12. Organizational Unit Name (eg, section) []:
  13. Common Name (eg, YOUR name) []: 这里填域名或者IP
  14. Email Address []:
  15.  
  16. Please enter the following 'extra' attributes
  17. to be sent with your certificate request
  18. A challenge password []:
  19. An optional company name []:

3、建立crt

openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 2000

详细参阅:Setting up Apache with mod_ssl

随机日志

  • 不想入睡
  • 向浪漫之都进发
  • 也优化一下我的firefox
  • 照婚纱照,真的很辛苦
  • 有些公司真的绝了!
  • Leave a Reply