Linux Centos7下生成https自簽名證書
1、安裝openssl
yum install openssl
2、生成帶密碼的私有秘鑰文件
openssl genrsa -des3 -out server.key 2048
使用帶密碼的私有秘鑰文件時需要輸入密碼,這里直接輸入:123456

3、生成不帶密碼的私有秘鑰文件
openssl rsa -in server.key -out server.key
4、生成證書文件
openssl req -new -x509 -key server.key -out server-ca.crt -days 3650
這里需要輸入信息,隨便填寫即可

5、生成證書基本信息server.csr
openssl req -new -key server.key -out server.csr

6、生成簽名證書
openssl x509 -req -days 3650 -in server.csr -CA server-ca.crt -CAkey server.key -CAcreateserial -out server.crt

7、生成pem格式證書(用于導(dǎo)入導(dǎo)出)
openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt
這里讓輸入密碼直接為空

8、生成pfx證書
cat server.crt server.key > server.pem

知識補充
CentOS7下ssl自簽名證書
生成帶密碼的私有秘鑰文件
openssl genrsa -des3 -out server.key 2048
生成不帶密碼的私有秘鑰文件
openssl rsa -in server.key -out server.key
生成證書文件
openssl req -new -x509 -key server.key -out server-ca.crt -days 3650
生成證書基本信息server.csr
openssl req -new -key server.key -out server.csr
生成簽名證書
openssl x509 -req -days 3650 -in server.csr -CA server-ca.crt -CAkey server.key -CAcreateserial -out server.crt
生成pem格式證書(用于導(dǎo)入導(dǎo)出)
openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt
生成pfx證書
cat server.crt server.key > server.pem
到此這篇關(guān)于Linux Centos7下生成https自簽名證書的文章就介紹到這了,更多相關(guān)Centos7生成https自簽名證書內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Ubuntu18.04 linux系統(tǒng)安裝JDK與Mysql的方法
這篇文章主要介紹了Ubuntu18.04 linux系統(tǒng)安裝JDK與Mysql的方法,需要的朋友可以參考下2020-02-02
linux上TCP connection timeout問題解決辦法
這篇文章主要介紹了 linux上TCP connection timeout問題解決辦法的相關(guān)資料,需要的朋友可以參考下2017-04-04
在linux (centos)上使用puppeteer實現(xiàn)網(wǎng)頁截圖功能
這篇文章主要介紹了在linux (centos)上使用puppeteer實現(xiàn)網(wǎng)頁截圖功能,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2019-11-11

