站長資訊網
        最全最豐富的資訊網站

        linux系統自簽發免費ssl證書,為nginx生成自簽名ssl證書

        安裝nginx可參考:
        nginx重新編譯支持ssl可參考:
        接下來手動配置ssl證書:
        自己手動頒發證書的話,那么https是不被瀏覽器認可的,就是https上面會有一個大紅叉
        下面是手動頒發證書的操作

        切換到nginx配置文件

          # cd /usr/local/nginx/conf

        創建配置證書目錄

          # mkdir ssl  # cd ssl

        1.生成私鑰

          openssl genrsa -des3 -out cert.key 1024   #生成1024的證書私鑰  Generating RSA private key, 1024 bit long modulus  ............++++++  ......................++++++  e is 65537 (0x10001)  Enter pass phrase for cert.key:  #提示輸入密碼  Verifying - Enter pass phrase for cert.key:  #確認密碼

        linux系統自簽發免費ssl證書,為nginx生成自簽名ssl證書

        2.創建證書請求

          #  openssl req -new -key cert.key -out cert.csr  Enter pass phrase for cert.key:   #輸入密碼  You are about to be asked to enter information that will be incorporated  into 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 blank  For some fields there will be a default value,  If you enter '.', the field will be left blank.    -----  Country Name (2 letter code) [AU]:cn   #國家  State or Province Name (full name) [Some-State]:shanghai #省份  Locality Name (eg, city) []:shanghai  #地區名字  Organization Name (eg, company) [Internet Widgits Pty   Ltd]:westos   #公司名  Organizational Unit Name (eg, section) []:linux  #部門  Common Name (e.g. server FQDN or YOUR name) []:server #CA主機名  Email Address []:root@server  #郵箱    Please enter the following 'extra' attributes  to be sent with your certificate request  A challenge password []:123456  #證書請求密鑰,CA讀取證書的時候需要輸入密碼  An optional company name []:123456  #公司名稱,CA讀取證書的時候需要輸入名稱

        linux系統自簽發免費ssl證書,為nginx生成自簽名ssl證書

          # cp cert.key cert.key.bak
          # openssl rsa -in cert.key.bak -out cert.key  Enter pass phrase for cert.key.bak:    #輸入密碼  writing RSA key  

        linux系統自簽發免費ssl證書,為nginx生成自簽名ssl證書

        3.自簽署證書

        ·“`
        #openssl x509 -req -days 365 -in cert.csr -signkey cert.key -out cert.pem
        Signature oksubject=/C=cn/ST=shanghai/L=shanghai/O=westos/OU=linux/CN=server/emailAddress=root@server<br "="" rel="nofollow">br>subject=/C=cn/ST=shanghai/L=shanghai/O=westos/OU=linux/CN=server/emailAddress=root@server

          ![](http://i2.51cto.com/images/blog/201810/25/0645650a76a40436c026da566e3304bb.pngx-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
          # ll  total 16  -rw-r--r-- 1 root root 749 Oct 25 15:33 cert.csr  -rw-r--r-- 1 root root 891 Oct 25 16:13 cert.key  -rw-r--r-- 1 root root 963 Oct 25 16:12 cert.key.bak  -rw-r--r-- 1 root root 920 Oct 25 16:16 cert.pem

        linux系統自簽發免費ssl證書,為nginx生成自簽名ssl證書

        4.將證書導出成瀏覽器支持的p12

          # openssl pkcs12 -export -clcerts -in cert.pem -inkey cert.key -out cert.p12  Enter Export Password:  Verifying - Enter Export Password:  [root@localhost ssl]# ls  cert.csr  cert.key  cert.key.bak  cert.p12  cert.pem

        linux系統自簽發免費ssl證書,為nginx生成自簽名ssl證書

        5.p12文件中導出公鑰和私鑰

        生成cert.key文件

          openssl pkcs12 -in cert.p12 -nocerts -nodes -out cert.key

        導出公鑰

          # openssl rsa -in cert.key -out cert_pri.pem  writing RSA key  

        linux系統自簽發免費ssl證書,為nginx生成自簽名ssl證書
        導出私鑰

          # openssl rsa -in cert.key -pubout -out cert_pub.pem

        贊(0)
        分享到: 更多 (0)
        網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
        主站蜘蛛池模板: 国产精品一区二区不卡| 精品免费tv久久久久久久| 国产精品偷伦视频观看免费| 精品人妻码一区二区三区| 久久精品不卡| 2021国产成人精品久久| 精品视频无码一区二区三区| 久久se精品一区精品二区国产| 国产成人精品精品欧美 | 精品无码国产污污污免费网站| 久久精品夜色噜噜亚洲A∨| 精品成人免费自拍视频| 亚洲欧美精品AAAAAA片| 国产精品自产拍在线观看花钱看| 91视频国产精品| 四虎成人精品免费影院| 精品一区二区三区自拍图片区 | 亚洲AⅤ永久无码精品AA| 国产精品麻豆入口| 杨幂国产精品福利在线观看| 91精品视频网站| 国产精品无码无需播放器| 亚洲αv在线精品糸列| 亚洲精品欧美精品日韩精品| 欧美精品亚洲日韩aⅴ| 蜜桃麻豆www久久国产精品| 精品国产热久久久福利| 国产成人精品一区在线| 亚洲国产精品久久| 欧美精品福利视频| 日韩精品www| 午夜精品视频在线| 欧美精品一本久久男人的天堂| 精品国产自在在线在线观看| 国产精品自产拍在线观看| 精品视频一区二区三区免费| 国产亚洲精品va在线| 精品一区二区三区中文字幕 | 国产成人久久精品区一区二区| 国产精品成人观看视频国产奇米| 日韩av无码久久精品免费|