首页 技术 正文
技术 2022年11月18日
0 收藏 503 点赞 4,769 浏览 2392 个字

add by zhj: 在http://www.cnblogs.com/ajianbeyourself/p/3898911.html中提到:

对于不受信任的证书,浏览器会发出告警,不过这些也只是告警而已,它不会禁止你访问。常用的浏览器(如FireFox、Chrome)会给你提

供两种方案:第一种方案是你可以选择继续访问,这样在你关闭浏览器之前,可以访问包含该根URL下的所有URL,但是当你关闭浏览器后,再次

打开时还会有警告,我们可以认为,浏览器只是临时把证书添加到了受信任的证书颁发机构,关闭浏览器后,就把它删除了。第二种方案是允许你

永久将该证书添加到受信任的证书颁发机构,这样,即使你关闭浏览器,再次打开后该证书还有效。

在客户端收到证书后会检查,比如检查证书的颁发机构是否是客户端自己信任的颁发机构,检查客户端访问服务器时所用的根URL与证书的

Common Name是否一致,当然除这两项外,还有其它项的检查,如果有检查不通过,那该证书就是不受信任的证书。自签证书就是不受信任的证书,

因此本文中提供的方案适用于自签证书。Chrome提供的第一种方案是直接在Chrome的地址栏输入该root URL,出现类似图2的警告,选择“继续”;

第二种方案是将证书的颁发机构(其实就是用putty生成证书请求时填写的Common Name,即服务器域名或IP)添加到受信任的根证书颁发机构,

因为Postman是Chrome的插件,所以如果Chrome将证书添加到了受信任的证书颁发机构,那Postman也就信任了。下面就说一下这两种方案,此

方案在Win7上用Chrome测试成功。

第一种方案——临时添加到受信任的证书颁发机构:

当使用不受信任的证书时,在Postman中访问接口时,会抛出图1所示的错误。这时我们需要在Chorme地址栏中访问该URL,它会出现图2所示的

界面,点击“继续”按钮,这样Chrome就将证书临时添加到了受信任的证书颁发机构,这样Postman就可以用了。当然,如果关闭了Chorme,再次打开

时Postman又会出现相同的错误。

在Postman中使用不受信任的SSL证书(转)

图1

在Postman中使用不受信任的SSL证书(转)

图2

第二种方案——永久添加到受信任的证书颁发机构:

Windows

1、在Chrome地址栏输入URL,如https://www.xiaobai.net:8000,只要是这个域名下的任何一下https URL都可以,出现图3的界面,我们不用关心这个

页面显示什么,因为使用不同的web服务器以及不同的设置,出现的错误是不同的。只需关心那个打红X的锁就行了。

在Postman中使用不受信任的SSL证书(转)

图3

2、点击https前面的那个锁,出现图4的窗口,点击“证书信息”,出现图5的窗口,在“详细信息”一栏,点击复制到文件,然后一步步使用

默认设置就行,文件格式用DER 编码二进制 X.509(.CER)。

在Postman中使用不受信任的SSL证书(转)               在Postman中使用不受信任的SSL证书(转)

图4                                                                                     图5

3.进入Chrome->设置,搜索”ssl”或”证书”,如图6,点击“管理证书”,出现图7的窗口,在“受信任的根证书颁发机构”一栏,点击“导入”,导入

之前保存的证书,导入过程中使用默认设置就行了,比如在证书存储那一步,如图8所示。最后出提示导入成功。然后重启Chrome就行了。

在Postman中使用不受信任的SSL证书(转)

图6

在Postman中使用不受信任的SSL证书(转)

图7

在Postman中使用不受信任的SSL证书(转)

图8

Mac OS X

1. Go to the root URL in your browser. For ex. https://localhost
2. Click on the lock icon on the top left in the URL bar.
3. Open the Connection tab in the dropdown that comes up
4. Click on certificate information

5. In the dialog that comes up, click and drag the certificate icon to your desktop to create a *.cer file

在Postman中使用不受信任的SSL证书(转)
6. Double click on the file to open the OS X Keychain Access tool.
7. Add the certificate to the System keychain and select “Always trust”

在Postman中使用不受信任的SSL证书(转)
8. Once the certificate is added, double click it to open more details

在Postman中使用不受信任的SSL证书(转)
9. Expand the Trust item
10. Select “Always trust”

在Postman中使用不受信任的SSL证书(转)
11. Close Keychain Access and restart Chrome

Linux

1. Go to the root URL in your browser. For ex. https://localhost
2. Click on the lock icon on the top left in the URL bar.
3. Open the Connection tab in the dropdown that comes up
4. Click on certificate information

5. Go to the Details tab

在Postman中使用不受信任的SSL证书(转)
6. Select Export and save the file on your disk

在Postman中使用不受信任的SSL证书(转)在Postman中使用不受信任的SSL证书(转)
7. Go to Chrome > Settings, search for SSL (chrome://settings/search#ssl) and click on Manage certificates
8. Go into the Authorities tab

在Postman中使用不受信任的SSL证书(转)
9. Import the certificate
10.Restart Chrome

参考:http://blog.getpostman.com/index.php/2014/01/28/using-self-signed-certificates-with-postman/

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,955
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,479
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,291
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,108
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,740
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,774