postman支持https

2020-12-07  本文已影响0人  手捧樱花v
  1. 证书名称sakura.keystone 有效期十年 默认90天(为服务器生成证书)
keytool -genkey -v -alias tomcat -keyalg RSA -keystore /Users/SakuraTheBest/Desktop/sakura.keystone -validity 36500
  1. 浏览器证书格式应该是PKCS12,双击sakura.p12文件导入浏览器(为客户端生成证书)
keytool -genkey -v -alias mykey -keyalg RSA -storetype PKCS12 -keystore /Users/SakuraTheBest/Desktop/sakura.p12
  1. SSL双向认证,必须把客户端证书添加为服务器的信任认证。由于不能直接将PKCS12格式的证书库导入,必须先把客户端证书导出为一个单独的CER文件,此处password为自己的密码(让服务器信任客户端证书)
keytool -export -alias mykey -keystore /Users/SakuraTheBest/Desktop/sakura.p12 -storetype PKCS12 -storepass password -rfc -file /Users/SakuraTheBest/Desktop/sakura.cer

文件导入证书服务器

keytool -import -v -file /Users/SakuraTheBest/Desktop/sakura.cer -keystore /Users/SakuraTheBest/Desktop/sakura.keystore

通过list命令查看服务器的证书库,可以看到两个证书,一个是服务器证书,一个是受信任的客户端证书

keytool -list -keystore /Users/SakuraTheBest/Desktop/sakura.keystore
  1. 客户端信任服务器证书
keytool -keystore /Users/SakuraTheBest/Desktop/sakura.keystore -export -alias tomcat -file /Users/SakuraTheBest/Desktop/sakura.cer
  1. 生成公钥
Openssl pkcs12 -in /Users/SakuraTheBest/Desktop/sakura.p12 -clcerts -out /Users/SakuraTheBest/Desktop/public_key.pem
  1. 生成私钥
openssl pkcs12 -in /Users/SakuraTheBest/Desktop/sakura.p12 -nodes -out /Users/SakuraTheBest/Desktop/private_key.pem
  1. 关闭SSL认证 off SSL certi
  2. 添加密钥


    key
  3. 访问成功


    163
上一篇 下一篇

猜你喜欢

热点阅读