最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Charles中设置SSL证书以支持抓取https和CONNECT请求不显示unknown

证书 crifan 1188浏览 0评论
折腾:
【未解决】Charles中如何抓取CONNECT请求返回响应中的data数据
期间,才
Web调试工具Charles使用心得 – 掘金
看到说是:
如果请求的host显示unknown,那么就是需要去添加设置https,ssl证书了。
而此处抓包xxx的视频页面所对应的:
cdn2.xxx.cn
中:
CONNECT cdn2.xxx.cn:443 HTTP/1.1
的确出现了几个请求,都是unknown:
所以需要去设置证书信任
Charles配置抓包HTTP,HTTPS – CSDN博客
去试试
至少希望能解决此处cdn2.xxx.cn的<unknown>的问题
然后再去考虑 CONNECT提取数据的问题
结果发现此处选中的是个Alipay的证书:
不是我们要的Charles的证书?
重新去找:
登录-》证书-》Charles Proxy CA
然后再去右键-》显示简介-》信任:
改为 使用此证书时:始终信任
然后会弹出对话框,让你输出Mac电脑用户的密码
然后就显示已信任了:
此证书已标记为受此账户信任
目前暂时只去添加:
*.xxx.*
点击问号查看到帮助:
”Location matching
The location match contains protocol, host, port and path fields that may be used to match the URL of the request. Any of the fields may be left blank, in which case they will match any value.
Wildcards
Wildcards are supported using either *, ? or character ranges […]. The * matches zero or more characters. The ? matches one character. Character ranges match one character in the range, eg. [a-z] or [aeiou].
Paths
To match subpaths you must end your path with a /*. NOTE: In previous versions of Charles this was implicit, but it is now required.
Query
The query field matches the query string contents. Do not include the ? that starts the query string. Note that the ? character is a wildcard character.
The query field can include wildcards, like the other fields, so you can do queries such as: “*page=1*” to match “page=1” anywhere in the query string.
Common Uses
To match every request to a given host enter the host name and leave the other fields blank. To match every request to a given path on a host enter the host name and the path ending with a /, leave the other fields blank. To match every file with a given suffix on a host enter the host name and /*.suffix, leave the other fields blank.
Examples
Host
Path
Result
Matches all requests to host charlesproxy.com
Matches all requests to hosts ending in .charlesproxy.com
/charles/
Matches all requests to charlesproxy.com/charles/ only
/charles/*
Matches all requests to charlesproxy.com/charles/ including files and subpaths
/charles
Matches all requests to charlesproxy.com/charles only
/index.html
Matches all requests to charlesproxy.com/charles.html only
/*.html
Matches all requests to files ending in .html on host charlesproxy.com
/charles/*.html
Matches all requests to files ending in .html under the path /charles/ (including subpaths) on any host
Protocol and port matches can be added to the above to further narrow the location match.
然后再去给android手机端去安装证书:
【已解决】给Android手机锤子M1L中安装Charles的pem证书文件
然后再去试试,结果:
【已解决】Charles已安装证书且开启SSL但https请求出错:Client SSL handshake failed – Remote host closed connection during handshake
最终整理出完全的操作流程和注意事项,详见:
【整理】Mac中用Charles抓包iOS或Android手机app中包括https的数据

转载请注明:在路上 » 【已解决】Charles中设置SSL证书以支持抓取https和CONNECT请求不显示unknown

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.195 seconds, using 23.34MB memory