創建自簽證書步驟

  1. 根證書創建
$ openssl genrsa -out ca.key 2048
$ openssl req -new -x509 -days 36500 -key ca.key -out ca.crt -subj "/C=CN/ST=shanxi/L=taiyuan/O=cn/OU=test/CN=example.com"
$ #或者 openssl req -new -x509 -days 36500 -key ca.key -out ca.crt 手動輸入配置
  1. 創建證書並使用根證書籤發
$ openssl genrsa -out app.key 2048
$ openssl req -new -key app.key -out app.csr
$ openssl x509 -req -in app.csr -CA ca.crt -CAkey ca.key -out app.crt -days 3650  -CAcreateserial
  1. 使用 Openssl 工具查看證書信息
$ openssl x509 -in app.crt -noout -dates
$ openssl x509 -in app.crt -noout -subject
$ openssl x509 -in app.crt -noout -text
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章