Https requests using charles grip guide (revolutions, has been verified + terminal emulator mac)

Charles caught using https requests, here need to set the end that is connected to the browser or application, and Charles ends, to complete the SSL Proxying settings.

SSL Certificates

Charles connection need to install the certificate, the following describes how Charles trusted root certificate on different browsers or applications

Windows/Internet Explorer

Operation:
1, Charles- "the Help-" SSL proxying in> the Install Root Certificate Charles, a window will pop up warning you do not trust Certificate Root CA
2, click on the "Install Certificate" button to load the wizard to import the certificate, the certificate must be imported to "Trusted Root certification Authorities" certificate store, it will automatically overwrite the contents of the current certificate store
3, after the certificate is installed, you need to restart IE to take effect

Mozilla Firefox

To ensure that the choice firefox connected to charles
method of checking:
in firefox visit the link to view the requested information in the charles in firefox

firefox installed Chalres root certificate as follows:
1, using the access firefox: https://chls.pro/ssl
time firefox be prompted:

 

2. Click Confirm Security Exception, then the following window will pop up, check the "Trust Certificate sites institution thus identified."
 

3. Click OK to install the certificate that is trusted and successful

macOS

操作:
1、Charles-》Help-》SSL Proxying > Install Charles Root Certificate
2、会打开钥匙串,在钥匙串中找到“Charles Proxy...”,双击打开
3、在信任选项里,使用此证书时:选择“始终信任”,如下


 

4、设置成功后关闭窗口时,会要求输入当前管理员密码来确认修改
5、重新启动safari,查看设置是否成功

iOS devices

1、首先要设置手机的wifi代理到Charles上
设置-》无线局域网-》当前连接的wifi,设置手动http代理
服务器为要Charles所在的电脑ip,Charles端口号默认是8888


 
图4

2、在手机端打开safari,输入: https://chls.pro/ssl,safari会提示你安装证书,安装完成如下

 

3、如果是在iOS 10.3及以上系统版本,需要在通用>关于手机>证书信任设置中找到Charles证书,打开信任开关,更多信息可以参考官网文档(More information about this change in iOS 10).

ps:
描述文件与设备管理在iOS设置中的路径:设置-》通用-》描述文件

iOS Simulators

在iOS模拟器上安装Charles证书,首先先退出模拟器
1、打开Charles,点击Charles-》Help-》SSL Proxying > Install Charles Root Certificate in iOS Simulators,即会安装Charles根证书到你所有的iOS模拟器上
2、再次启动iOS模拟器时,就可以正常使用SSL Proxying

tvOS

这个用的比较少,这里就不多做描述,想要了解的可以直接看官网文档

Android

在Android内,要信任Charles SSL Proxying生成的 SSL 证书,需要在你的app内添加一些配置,也就是说你只能在自己的app内使用SSL Proxying。
关于网络安全配置详细的可见android官网文档

要添加的这个文件会覆盖系统默认的,能够使你的app信任已安装的CA
certificates(如 Charles根证书)。可以只将这个设置应用于debug包,以便宜生产包使用默认的信任配置
1、在你的app中添加文件res/xml/network_security_config.xml:

<network-security-config> 
  <debug-overrides> <trust-anchors> <!-- Trust user added CAs while debuggable only --> <certificates src="user" /> </trust-anchors> </debug-overrides> </network-security-config> 

2、在manifest中添加一个reference:

<?xml version="1.0" encoding="utf-8"?>
<manifest ... > <applicationandroid:networkSecurityConfig="@xml/network_security_config" ... > ... </application> </manifest> 

Google Chrome

In macOS, reference macOS described above. The following applies only to Windows
1, Charles- "the Help-" SSL proxying in> the Save Charles Root Certificate, saved as a binary file (.cer extension) to local
2, in Chrome, open the Settings page, set at the bottom of the page click on "Advanced "button to open the advanced options, click on the" manage certificates "button
3, open a trusted root certificate tab, click the import step certificate stored in 1, follow the prompts to import until the import is successful
after 4, the import was successful, step 1 certificate file can deleted

Java Applications

The use of relatively small, do not describe here, want to know you can directly see the official website documents

Python

The use of relatively small, do not describe here, want to know you can directly see the official website documents

Charles set the crawl https request

After installing the above good Charles root certificate, you also need to set up SSL Proxy in Charles normal crawl https requests of
1, click Charles- "Proxy-" SSL Proxying Settings ...

 

2, SSL Proxying Settings page SSL Proxying item, click Add, add the domain name and port number for a full match: *:443 and check the "Enable SSL Proxying", click OK to save
 

3, after successfully saved, in the browser or application to normal fetch request https

 

Guess you like

Origin www.cnblogs.com/yujinzhong/p/12123347.html