標籤:https ssl
為網域名稱 https.ssl.com 設定https 加密訪問過程:命令如下:#openssl genrsa -des3 -out https.ssl.com.key 1024#openssl req -new -key https.ssl.com.key -out https.ssl.com.csr#openssl rsa -in https.ssl.com.key -out https.ssl.com_nopass.key#openssl -req -new -x509 -days 3650 -key https.ssl.com_nopass.key -out https.ssl.com.crt[[email protected] key]# openssl genrsa -des3 -out https.ssl.com.key 1024Generating RSA private key, 1024 bit long modulus........++++++............++++++e is 65537 (0x10001)Enter pass phrase for https.ssl.com.key:輸入密碼Verifying - Enter pass phrase for https.ssl.com.key:重複輸入密碼[[email protected] key]# openssl req -new -key https.ssl.com.key -out https.ssl.com.csrEnter pass phrase for https.ssl.com.key:輸入前面設定的密碼You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.‘, the field will be left blank.-----Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:Shanghai Locality Name (eg, city) [Default City]:ShanghaiOrganization Name (eg, company) [Default Company Ltd]:https.ssl.comOrganizational Unit Name (eg, section) []:https.ssl.comCommon Name (eg, your name or your server‘s hostname) []:*.https.ssl.com Email Address []:[email protected]Please enter the following ‘extra‘ attributesto be sent with your certificate requestA challenge password []:直接斷行符號An optional company name []:直接斷行符號[[email protected] key]# openssl rsa -in https.ssl.com.key -out https.ssl.com_nopass.keyEnter pass phrase for https.ssl.com.key:輸入密碼writing RSA key [[email protected] key]# openssl req -new -x509 -days 3650 -key https.ssl.com_nopass.key -out https.ssl.com.crt You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.‘, the field will be left blank.-----Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:ShanghaiLocality Name (eg, city) [Default City]:ShanghaiOrganization Name (eg, company) [Default Company Ltd]:https.ssl.comOrganizational Unit Name (eg, section) []:https.ssl.comCommon Name (eg, your name or your server‘s hostname) []:*.https.ssl.comEmail Address []:[email protected][[email protected] key]#設定檔中server { listen 80; listen 443; server_name https.ssl.com; ssl on; ssl_certificate ./https.ssl.com.crt; ssl_certificate_key ./https.ssl.com_nopass.key; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; index index.html index-test.php; .... } 既可以https訪問此網域名稱。。
本文出自 “好記性不如爛筆頭” 部落格,請務必保留此出處http://cobweb.blog.51cto.com/390607/1591521
SSL 設定網域名稱訪問