https://blog.csdn.net/ONS_cukuyo/article/details/79172242

单向认证

像平常一样访问就行,无需做任何处理,只需要把http://变成https://

双向认证

postman不支持安全链接的请求

因此我们接下来需要:

1. File->Setting->General,关闭“SSL certificate verification”

postman不支持安全链接的请求

2. 在上面的弹出界面中选择Certificates,并点击 添加证书

postman不支持安全链接的请求

CRT file为客户端**库的公钥

KEY file为客户端**库的私钥

Passphrase为**库的密码,经测试,不填写也没关系(或许这里暗示了使用pkcs12格式的?因为pkcs12在生成时只需要**库密码)

但keytool没有从一个**库提取出公钥和私钥的功能,所以我们转而去寻找在Window上安装证书的地方,看是否有导出证书相关的功能。最后找到了导出私钥的选项,但是却不能选,结果如图:

postman不支持安全链接的请求

所以,在百度了之后,了解到可以用openssl对一个pkcs12格式**库进行公钥和私钥的导出

仅仅输出客户端证书到文件中:

openssl pkcs12 -in file.p12 -clcerts -out public_key.pem

不加密私钥文件:

openssl pkcs12 -in file.p12 -nodes -out private_key.pem

 

最终结果如图:

 

postman不支持安全链接的请求

重新发送请求,成功!

以上openssl命令来自:http://blog.csdn.net/as3luyuan123/article/details/16105475

相关文章:

  • 2021-12-17
  • 2021-10-29
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-11-20
  • 2021-06-08
猜你喜欢
  • 2022-12-23
  • 2021-10-29
  • 2021-06-21
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
相关资源
相似解决方案