Charles Agent and its operations on crawling HTTPS information

Source: Internet
Author: User
Tags pkcs12

has not written an article about Charles to record, but found that occasionally will forget, so still remember, it is more convenient to look up.

First, after installing Charles, the default local proxy address is the 127.0.0.1:8888 address. If you want to proxy HTTP traffic or socks traffic to the local computer, you can set the proxy address to the 127.0.0.1:8888 address, and you'll be able to see what traffic is currently being used on Charles.

In fact, my usual agent is not the traffic on the agent PC, because most modern browsers come with the ability to look at the package, so more time, I may need to use it to proxy the traffic on my phone, especially when testing the interface and API.

The first is the most commonly used proxy function, will arrive at the local traffic mapped to other addresses above.

Tool->map-remote-setting

This interface appears

Click Add to add Mapping settings

This is where to fill in the address from which to map.

For example, we are going to Baidu agent to our own address.

The above can be set Baidu host www.baidu.com then port80 or 8080

Here we set our own address such as Zhizhizhi.me and then set the port.

To get Charles to see the contents of the HTTPS packet, first we need to install the root certificate of Charles in our own computer and trust it.

help->sslproxying-> Install Charles Root Certificate. Install it and trust it.

Then enable the Charles SSL proxy

proxy-> SSL Proxy Setting

Tick Enable SSL proxying

and set up a client certificate issued by the root certificate that the server belongs to, here I use a certificate in the P12 format. Then specify the agent host for the listener

At this point, Charles can proxy your HTTPS request to the target server.

If you need Charles to proxy your phone to access HTTPS for the destination address, you'll also need to install the Charles certificate on your phone, and it's easy.

Help->ssl proxying-> Install Charles Root Certificate Devices Or Remote Browser This time will give you an intranet address for installing the certificate

Access this address to download and install the Charles Certificate.

The principle of proxy SSL traffic here is also simple:

Why to install the Charles Root certificate:

Because Charles eventually agent our SSL traffic is sent back to us, and this process is our SSL communication with the local Charles agent, if we do not have the root certificate signed by Charles, then we will not be able to trust Charles forwarded any SSL traffic.

In addition, we can decrypt the encrypted data sent by the specified host server, because we set up a package file in Charles that corresponds to the client certificate in PKCS12 format (PKCS12 contains the public key that was checked out by the root certificate). To see the data in these packets like the packet HTTP packet. Charles is responsible for sending and receiving encrypted data instead of us and the server, and we need to communicate with Chales itself again, so it should be more clear.

Preference:

Https://en.wikipedia.org/wiki/PKCS_12 Pkcs12wiki

Charles Agent and its operations on crawling HTTPS information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.