1. 程式人生 > >WIN64使用OPENSSL生成SSL證書

WIN64使用OPENSSL生成SSL證書

nbsp 請求 md5 輸入 ssl證書 密碼 http 私鑰 x509

WIN64使用OPENSSL生成SSL證書

下載OPENSSL http://slproweb.com/products/Win32OpenSSL.html

生成服務器端的私鑰(key文件):
openssl genrsa -des3 -out root.key 1024
輸入密碼123456

請求建立證書的申請文件root.csr:
openssl req -new -key root.key -out root.csr -config openssl.cfg

創立一個為期10年的根證書root.crt
openssl x509 -req -days 3650 -sha1 -extensions v3_ca -signkey root.key -in root.csr -out root.crt

建立服務器證書秘鑰:
openssl genrsa -des3 -out server.key 2048

創立服務器證書申請文件,密碼仍為123456:
openssl req -new -key server.key -out server.csr -config openssl.cfg

創立為期10年的服務器證書server.crt, 密碼為123456:
openssl x509 -req -days 3650 -md5 -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in server.csr -out server.crt

WIN64使用OPENSSL生成SSL證書