<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>抓包 &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/%e6%8a%93%e5%8c%85/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Mon, 28 Nov 2022 18:25:24 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] Charles Proxy文章合集</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Sat, 19 Nov 2022 10:42:54 +0000</pubDate>
				<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[Charles Proxy]]></category>
		<category><![CDATA[代理]]></category>
		<category><![CDATA[抓包]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=13742</guid>

					<description><![CDATA[<p>Charles Proxy是一个HTTP代理/HTTP监视器/反向代理，它使开发人员能够查看其计算机和Internet之间的所有HTTP和SSL/HTTPS流量。这包括请求、响应和HTTP&#160;headers（其中包含cookie和缓存信息）。<br />
<span id="more-13742"></span><br />
➤ <a href="https://www.codelast.com/?p=13530" rel="noopener" target="_blank">用Charles Proxy来抓包Chrome浏览器的数据</a></p>
<p>➤&#160;<a href="https://www.codelast.com/?p=13392" target="_blank" rel="noopener">Charles Proxy抓包本地Java程序数据配置</a></p>
<p>➤&#160;<a href="https://www.codelast.com/?p=13689" rel="noopener" target="_blank">用Charles Proxy抓包iOS App的数据</a></p>
<p>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;版权声明&#160;<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&#160;<br />
	感谢关注我的微信公众号（微信扫一扫）：<br />
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
	以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" />&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>Charles Proxy是一个HTTP代理/HTTP监视器/反向代理，它使开发人员能够查看其计算机和Internet之间的所有HTTP和SSL/HTTPS流量。这包括请求、响应和HTTP&nbsp;headers（其中包含cookie和缓存信息）。<br />
<span id="more-13742"></span><br />
➤ <a href="https://www.codelast.com/?p=13530" rel="noopener" target="_blank">用Charles Proxy来抓包Chrome浏览器的数据</a></p>
<p>➤&nbsp;<a href="https://www.codelast.com/?p=13392" target="_blank" rel="noopener">Charles Proxy抓包本地Java程序数据配置</a></p>
<p>➤&nbsp;<a href="https://www.codelast.com/?p=13689" rel="noopener" target="_blank">用Charles Proxy抓包iOS App的数据</a></p>
<p>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：<br />
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
	以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 用Charles Proxy抓包iOS App的数据</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%8a%93%e5%8c%85ios-app%e7%9a%84%e6%95%b0%e6%8d%ae/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%8a%93%e5%8c%85ios-app%e7%9a%84%e6%95%b0%e6%8d%ae/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Sat, 19 Nov 2022 10:34:15 +0000</pubDate>
				<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[Charles Proxy]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[抓包]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=13689</guid>

					<description><![CDATA[<div style="text-align: center;">
	<img decoding="async" alt="charles proxy" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy.png" style="text-align: center; width: 571px; height: 221px;" /></div>
<p>查看Charles Proxy文章合集，请点击<a href="https://www.codelast.com/?p=13742" rel="noopener" target="_blank">这里</a>。</p>
<p><span style="color: rgb(255, 0, 0);">➤</span>&#160;使用场景<br />
当我们需要分析 iOS App 发送接收的数据时，需要对App进行抓包。可以在&#160;iOS&#160;上安装抓包工具来完成这个工作，更常见的做法是在PC上安装Charles Proxy之类的软件，再对&#160;iOS&#160;进行一定的配置让这二者关联起来，从而可以在PC上完成抓包工作。毕竟在PC大屏上进行数据分析比触屏的&#160;iOS&#160;设备更为方便。<br />
其基本原理是：Charles Proxy运行起来后，会在PC上启动一个代理服务器，在 iOS&#160;设备上配置通过这个代理服务器来访问网络，那么iOS上的HTTP流量都将走过Charles Proxy，自然也就被Charles Proxy截获了数据。另外，对于HTTPS的加密流量，Charles Proxy还提供了一个SSL证书，把这个证书安装到&#160;iOS&#160;设备上，就可以让&#160;iOS App 发送的HTTPS流量被Charles Proxy&#160;解密，我们就能分析App发送的数据明文。<br />
<span id="more-13689"></span><br />
<span style="color: rgb(255, 0, 0);">➤</span>&#160;软件环境<br />
PC：macOS 13.0.1<br />
Charles Proxy：4.6.2<br />
iOS：15.7.1（其他版本的iOS也行，只不过在某些步骤上有些许差别而已）</p>
<p><span style="color: rgb(255, 0, 0);">➤</span>&#160;Charles Proxy配置<br />
下面的配置，诸如端口号之类的参数可以视实际情况修改。<br />
依次点击菜单设置：<br />
（1）Proxy&#8594;Proxy Settings<br />
<a href="https://www.codelast.com" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_proxy_settings_1.png" style="width: 600px; height: 530px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<a href="https://www.codelast.com" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_proxy_settings_2.png" style="width: 600px; height: 532px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
（2）Proxy&#8594;SSL Proxy Settings<br />
<a href="https://www.codelast.com" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy ssl proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_ssl_proxy_settings.png" style="width: 600px; height: 484px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%8a%93%e5%8c%85ios-app%e7%9a%84%e6%95%b0%e6%8d%ae/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<div style="text-align: center;">
	<img decoding="async" alt="charles proxy" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy.png" style="text-align: center; width: 571px; height: 221px;" /></div>
<p>查看Charles Proxy文章合集，请点击<a href="https://www.codelast.com/?p=13742" rel="noopener" target="_blank">这里</a>。</p>
<p><span style="color: rgb(255, 0, 0);">➤</span>&nbsp;使用场景<br />
当我们需要分析 iOS App 发送接收的数据时，需要对App进行抓包。可以在&nbsp;iOS&nbsp;上安装抓包工具来完成这个工作，更常见的做法是在PC上安装Charles Proxy之类的软件，再对&nbsp;iOS&nbsp;进行一定的配置让这二者关联起来，从而可以在PC上完成抓包工作。毕竟在PC大屏上进行数据分析比触屏的&nbsp;iOS&nbsp;设备更为方便。<br />
其基本原理是：Charles Proxy运行起来后，会在PC上启动一个代理服务器，在 iOS&nbsp;设备上配置通过这个代理服务器来访问网络，那么iOS上的HTTP流量都将走过Charles Proxy，自然也就被Charles Proxy截获了数据。另外，对于HTTPS的加密流量，Charles Proxy还提供了一个SSL证书，把这个证书安装到&nbsp;iOS&nbsp;设备上，就可以让&nbsp;iOS App 发送的HTTPS流量被Charles Proxy&nbsp;解密，我们就能分析App发送的数据明文。<br />
<span id="more-13689"></span><br />
<span style="color: rgb(255, 0, 0);">➤</span>&nbsp;软件环境<br />
PC：macOS 13.0.1<br />
Charles Proxy：4.6.2<br />
iOS：15.7.1（其他版本的iOS也行，只不过在某些步骤上有些许差别而已）</p>
<p><span style="color: rgb(255, 0, 0);">➤</span>&nbsp;Charles Proxy配置<br />
下面的配置，诸如端口号之类的参数可以视实际情况修改。<br />
依次点击菜单设置：<br />
（1）Proxy&rarr;Proxy Settings<br />
<a href="https://www.codelast.com" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_proxy_settings_1.png" style="width: 600px; height: 530px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<a href="https://www.codelast.com" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_proxy_settings_2.png" style="width: 600px; height: 532px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
（2）Proxy&rarr;SSL Proxy Settings<br />
<a href="https://www.codelast.com" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy ssl proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_ssl_proxy_settings.png" style="width: 600px; height: 484px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
点击上图的&ldquo;Add&rdquo;按钮添加你想要抓包数据的域名：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy ssl proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_ssl_proxy_settings_edit_location.png" style="width: 500px; height: 222px;" /></a><br />
Port不用填。<br />
这里只是举一个例子，如果你要抓包的App访问的是其他域名，要把它们都添加进去。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
（3）Proxy&rarr;macOS Proxy（勾选）<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="charles proxy enable macos proxy" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_enable_masos_proxy.png" style="width: 500px; height: 488px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a></p>
<p><span style="color: rgb(255, 0, 0);">➤</span>&nbsp;iOS配置<br />
（1）在iOS上使用Charles Proxy启动的代理服务器来访问网络</p>
<blockquote>
<p>
		编辑WiFi网络连接&rarr;配置代理&rarr;选择&ldquo;手动&rdquo;&rarr;填上Charles Proxy的代理服务器IP地址及端口</p>
</blockquote>
<p>正如前面的图示，我们已经把端口设置成了8888，所以iOS代理配置的端口就填8888。<br />
那么代理服务器的IP地址是什么？点击Charles Proxy软件的菜单 <span style="color:#ff0000;">Help</span>&rarr;<span style="color:#ff0000;">Local IP&nbsp;Address</span>，在弹出的对话框中就可以看到IP地址。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
（2）安装Charles Proxy提供的证书<br />
Charles Proxy&nbsp;给了一个指南，告诉我们在iOS上应该怎么配置，点击菜单 <span style="color:#ff0000;">Help</span>&rarr;<span style="color:#ff0000;">SSL Proxying</span>&rarr;<span style="color:#ff0000;">Install Charles Root on a Mobile Device or Remote Browser</span>&nbsp;会弹出对话框：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_ssl_proxying.png" style="width: 600px; height: 141px;" /></a><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
它让我们在移动设备上用浏览器访问 <span style="color:#ff0000;">chls.pro/ssl</span>&nbsp;这个URL，照做：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_downloading_configuration_profile.jpg" style="width: 500px; height: 813px;" /><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
点击&ldquo;允许&rdquo;，再回到系统&ldquo;设置&rdquo;界面，会看到&ldquo;已下载描述文件&rdquo;：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_configuration_profile_downloaded.jpg" style="width: 400px; height: 552px;" /><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
点进去，会看到描述文件的信息：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_install_configuration_profile.jpg" style="width: 500px; height: 632px;" /><br />
点击右上角的&ldquo;安装&rdquo;，就可以把证书安装到iOS设备上了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
（3）证书过期的处理<br />
如果按照以上步骤操作之后，Charles Proxy可以抓包，但对HTTPS的数据仍然看不到明文，那么有可能是Charles Proxy的证书过期了，此时你需要点击菜单 <span style="color:#ff0000;">Help</span>&rarr;<span style="color:#ff0000;">SSL Proxying</span>&rarr;<span style="color:#ff0000;">Reset Charles Root Certificate</span>：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/11/charles_proxy_ios_app_reset_charles_root_certificate.png" style="width: 700px; height: 331px;" /></a><br />
然后回到iOS上，重新从安装证书开始执行一遍后面的步骤即可。<br />
上面的步骤完成后，回到Charles Proxy软件，会发现它已经可以成功抓包iOS App的数据了，包括HTTPS的流量。</p>
<p>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：<br />
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
	以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%8a%93%e5%8c%85ios-app%e7%9a%84%e6%95%b0%e6%8d%ae/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 用Charles Proxy来抓包Chrome浏览器的数据</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%9d%a5%e6%8a%93%e5%8c%85chrome%e6%b5%8f%e8%a7%88%e5%99%a8%e7%9a%84%e6%95%b0%e6%8d%ae/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%9d%a5%e6%8a%93%e5%8c%85chrome%e6%b5%8f%e8%a7%88%e5%99%a8%e7%9a%84%e6%95%b0%e6%8d%ae/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Fri, 18 Feb 2022 09:17:18 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Charles Proxy]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[抓包]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=13530</guid>

					<description><![CDATA[<div style="text-align: center;">
	<img decoding="async" alt="charles proxy" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy.png" style="width: 571px; height: 221px;" /></div>
<p>查看Charles Proxy文章合集，请点击<a href="https://www.codelast.com/?p=13742" target="_blank" rel="noopener">这里</a>。<br />
本文适用的操作系统：Ubuntu</p>
<blockquote>
<p>
		Charles Proxy是一个HTTP代理/HTTP监视器/反向代理，它使开发人员能够查看其计算机和Internet之间的所有HTTP和SSL/HTTPS流量。这包括请求、响应和HTTP headers（其中包含cookie和缓存信息）。</p>
</blockquote>
<p>在Chrome浏览器中把代理服务器设置成<a href="https://www.charlesproxy.com/" rel="noopener" target="_blank">Charles Proxy</a>在本地提供的代理，可以让Charles Proxy把Chrome的网络流量抓取下来。<br />
配置方法如下。<br />
<span id="more-13530"></span><br />
<span style="color:#0000ff;">➤</span> Charles Proxy端的配置<br />
<span style="color:#ff0000;">✔</span> Proxy&#8594;Proxy Settings：<br />
<img decoding="async" alt="charles proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy_settings.png" style="width: 500px; height: 492px;" /><br />
Charles Proxy软件打开后，会启动一个代理服务器，在这里你可以修改代理服务器的端口等信息，通常来说保持默认参数即可。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">✔</span>&#160;Proxy&#8594;SSL Proxying Settings：<br />
<img decoding="async" alt="charles ssl proxying settings" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_ssl_proxying_settings.png" style="width: 450px; height: 411px;" /><br />
勾选上&#8220;Enable SSL Proxying&#8221;，这样可以对https的流量进行抓包。<br />
并且在&#8220;Location&#8221;里设置你感兴趣的域名，注意：只有这些域名的流量会被抓包。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">✔</span>&#160;导出Charles Proxy的证书<br />
在Charles界面上点击菜单导出 .pem 证书：</p>
<blockquote>
<p>
		Help&#8594;SSL Proxying&#8594;Save Charles Root Certificate</p>
</blockquote>
<p>把文件保存到 ~/charles.pem&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%9d%a5%e6%8a%93%e5%8c%85chrome%e6%b5%8f%e8%a7%88%e5%99%a8%e7%9a%84%e6%95%b0%e6%8d%ae/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<div style="text-align: center;">
	<img decoding="async" alt="charles proxy" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy.png" style="width: 571px; height: 221px;" /></div>
<p>查看Charles Proxy文章合集，请点击<a href="https://www.codelast.com/?p=13742" target="_blank" rel="noopener">这里</a>。<br />
本文适用的操作系统：Ubuntu</p>
<blockquote>
<p>
		Charles Proxy是一个HTTP代理/HTTP监视器/反向代理，它使开发人员能够查看其计算机和Internet之间的所有HTTP和SSL/HTTPS流量。这包括请求、响应和HTTP headers（其中包含cookie和缓存信息）。</p>
</blockquote>
<p>在Chrome浏览器中把代理服务器设置成<a href="https://www.charlesproxy.com/" rel="noopener" target="_blank">Charles Proxy</a>在本地提供的代理，可以让Charles Proxy把Chrome的网络流量抓取下来。<br />
配置方法如下。<br />
<span id="more-13530"></span><br />
<span style="color:#0000ff;">➤</span> Charles Proxy端的配置<br />
<span style="color:#ff0000;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> Proxy&rarr;Proxy Settings：<br />
<img decoding="async" alt="charles proxy settings" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy_settings.png" style="width: 500px; height: 492px;" /><br />
Charles Proxy软件打开后，会启动一个代理服务器，在这里你可以修改代理服务器的端口等信息，通常来说保持默认参数即可。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span>&nbsp;Proxy&rarr;SSL Proxying Settings：<br />
<img decoding="async" alt="charles ssl proxying settings" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_ssl_proxying_settings.png" style="width: 450px; height: 411px;" /><br />
勾选上&ldquo;Enable SSL Proxying&rdquo;，这样可以对https的流量进行抓包。<br />
并且在&ldquo;Location&rdquo;里设置你感兴趣的域名，注意：只有这些域名的流量会被抓包。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span>&nbsp;导出Charles Proxy的证书<br />
在Charles界面上点击菜单导出 .pem 证书：</p>
<blockquote>
<p>
		Help&rarr;SSL Proxying&rarr;Save Charles Root Certificate</p>
</blockquote>
<p>把文件保存到 ~/charles.pem<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(0, 0, 255);">➤</span>&nbsp;Chrome浏览器端的配置（以Ubuntu系统上的Chrome为例）<br />
<span style="color: rgb(255, 0, 0);"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span>&nbsp;把证书导入Chrome<br />
依次打开Chrome的如下页面：<br />
&ldquo;<span style="color: rgb(0, 0, 255);">设置</span>&rdquo;&rarr;&ldquo;<span style="color: rgb(0, 0, 255);">安全和隐私设置</span>&rdquo;&rarr;&ldquo;<span style="color: rgb(0, 0, 255);">安全</span>&rdquo;&rarr;&ldquo;<span style="color: rgb(255, 0, 0);">管理证书</span>&rdquo;&rarr;&ldquo;<span style="color: rgb(255, 0, 0);">授权机构</span>&rdquo;：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/import_charles_proxy_ca_1.png" style="width: 668px; height: 182px;" /><br />
点击&ldquo;<span style="color:#0000ff;">导入</span>&rdquo;按钮，选择刚才生成的 .pem 证书文件，会弹出下面的对话框：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/import_charles_proxy_ca_2.png" style="width: 507px; height: 297px;" /><br />
勾选第一项。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2714.png" alt="✔" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span>&nbsp;配置Chrome的代理<br />
使用Chrome的SwitchyOmega插件，添加一个名为&ldquo;Charles Proxy&rdquo;的情景模式：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy_config_in_SwitchyOmega.png" style="width: 600px; height: 266px;" /><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(0, 0, 255);">➤</span>&nbsp;测试<br />
在Chrome的SwitchyOmega插件中选择刚配置好的Charles Proxy情景模式，再访问一个前面设置好的感兴趣的域名下的网页。<br />
在导入证书之前，会发现抓不了：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/before_trust_charles_proxy_ca.png" style="width: 600px; height: 74px;" /><br />
&mdash;&mdash;界面上全是红叉，以及 Failed。</p>
<p>在导入了证书之后，再试一次，会发现抓包可以成功完成：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/after_trust_charles_proxy_ca.png" style="width: 821px; height: 117px;" /><br />
&mdash;&mdash;状态码是200，以及Status是Complete，这说明一切正常。</p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：<br />
<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e7%94%a8charles-proxy%e6%9d%a5%e6%8a%93%e5%8c%85chrome%e6%b5%8f%e8%a7%88%e5%99%a8%e7%9a%84%e6%95%b0%e6%8d%ae/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] Charles Proxy抓包本地Java程序数据配置</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%8a%93%e5%8c%85%e6%9c%ac%e5%9c%b0java%e7%a8%8b%e5%ba%8f%e6%95%b0%e6%8d%ae%e9%85%8d%e7%bd%ae/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%8a%93%e5%8c%85%e6%9c%ac%e5%9c%b0java%e7%a8%8b%e5%ba%8f%e6%95%b0%e6%8d%ae%e9%85%8d%e7%bd%ae/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Fri, 24 Dec 2021 03:13:57 +0000</pubDate>
				<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[Charles Proxy]]></category>
		<category><![CDATA[JAVA程序]]></category>
		<category><![CDATA[抓包]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=13392</guid>

					<description><![CDATA[<p><melo-data data-src="{&#34;mainAtext&#34;:&#34;{\&#34;atext\&#34;:{\&#34;attribs\&#34;:\&#34;*0+c*1*2*3*4*5*0+1*0+q*1*0+1*0*6+4*0*7+1*0*6+c*0*7+1*0*6+t*1*0+1*0+7*0*8+d*1*0+2*0+j*9*3*a*5*0+1*0*b+f*c*3*5*0*b+1*0*b+16*0*8+d*0*b+1s*c*3*5*0*b+1*0+3*d*3*5*0+1*0*e*8+8*0*e+k*d*3*5*0*e+1*0*8+a*0*e*8+4*0*e+c*d*3*5*0+1*0*e*8+b*0*e+d*d*3*5*0*e+1*0*e*8+7*0*e+q*d*3*5*0*e+1*0*e+x*0*e*6+1*0*e+j*f*0*e+2\&#34;,\&#34;text\&#34;:\&#34;导出Charles的证书\\n在Charles界面上点击菜单导出 .pem 证书：\\nHelp→SSL Proxying→Save Charles Root Certificate\\n把文档保存到 ~/charles.pem\\n\\n把Charles的key导入到JVM中\\ncd /opt/jdk/bin\\nsudo keytool -import -alias charles -file ~/charles.pem -keystore /opt/jdk/jre/lib/security/cacerts -storepass changeit\\n其中：\\nchangeit 是 cacerts 文件中的默认密码；\\n-alias charles 是指定导入条目的别名；\\ncharles.pem 是上一步导出的证书文件；\\nkeytool 是 /opt/jdk/bin/ 目录下的一个程序。\\n最后会询问“是否信任此证书? ”，如果是中文的问题，输入中文 的“是”之后会提示“证书已添加到密钥库中”。\\n\\n\&#34;},\&#34;apool\&#34;:{\&#34;numToAttrib\&#34;:{\&#34;0\&#34;:[\&#34;author\&#34;,\&#34;p.144115217299900272\&#34;],\&#34;1\&#34;:[\&#34;pap-stylesheet-name\&#34;,\&#34;normal\&#34;],\&#34;2\&#34;:[\&#34;pap-list-id\&#34;,\&#34;wvgrl5\&#34;],\&#34;3\&#34;:[\&#34;pap-list-level\&#34;,\&#34;0\&#34;],\&#34;4\&#34;:[\&#34;pap-list-template-id\&#34;,\&#34;9qj2k5\&#34;],\&#34;5\&#34;:[\&#34;pap-list-task\&#34;,\&#34;\&#34;],\&#34;6\&#34;:[\&#34;color\&#34;,\&#34;#FF0000\&#34;],\&#34;7\&#34;:[\&#34;color\&#34;,\&#34;rgb(0,0,0)\&#34;],\&#34;8\&#34;:[\&#34;color\&#34;,\&#34;rgb(231,82,0)\&#34;],\&#34;9\&#34;:[\&#34;pap-list-id\&#34;,\&#34;cpe9c0\&#34;],\&#34;10\&#34;:[\&#34;pap-list-template-id\&#34;,\&#34;oz94x2\&#34;],\&#34;11\&#34;:[\&#34;color\&#34;,\&#34;rgb(64,62,214)\&#34;],\&#34;12\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;0em\&#34;],\&#34;13\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;0pt\&#34;],\&#34;14\&#34;:[\&#34;font-family\&#34;,\&#34;\\\&#34;Helvetica Neue\\\&#34;,Helvetica,\\\&#34;PingFang SC\\\&#34;,\\\&#34;Microsoft YaHei\\\&#34;,\\\&#34;Source Han Sans SC\\\&#34;,\\\&#34;Noto Sans CJK SC\\\&#34;,\\\&#34;WenQuanYi Micro Hei\\\&#34;,sans-serif\&#34;],\&#34;15\&#34;:[\&#34;snapToGrid\&#34;,\&#34;1\&#34;]},\&#34;nextNum\&#34;:16}}&#34;,&#34;storyAtexts&#34;:[{&#34;storyId&#34;:&#34;LSTTMP&#34;,&#34;atext&#34;:&#34;{\&#34;atext\&#34;:{\&#34;attribs\&#34;:\&#34;*0*1*2*3*4*5*6*7*8+1*0*9*2*a*4*5*b*7*8+1*0*c*2*d*4*5*e*7*8+1*0*1*2*f*4*5*g*7*8+1*0*9*2*h*4*5*i*7*8+1*0*c*2*j*4*5*k*7*8+1*0*1*2*l*4*5*m*7*8+1*0*9*2*n*4*5*o*7*8+1*0*1*2*3*4*5*6*p*8+1*0*9*2*a*4*5*b*p*8+1*0*c*2*d*4*5*e*p*8+1*0*1*2*f*4*5*g*p*8+1*0*9*2*h*4*5*i*p*8+1*0*c*2*j*4*5*k*p*8+1*0*1*2*l*4*5*m*p*8+1*0*9*2*n*4*5*o*p*8+1\&#34;,\&#34;text\&#34;:\&#34;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\&#34;},\&#34;apool\&#34;:{\&#34;numToAttrib\&#34;:{\&#34;0\&#34;:[\&#34;list-start\&#34;,\&#34;0\&#34;],\&#34;1\&#34;:[\&#34;list-text\&#34;,\&#34;●\&#34;],\&#34;2\&#34;:[\&#34;list-format\&#34;,\&#34;bullet\&#34;],\&#34;3\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;0em\&#34;],\&#34;4\&#34;:[\&#34;pap-specialIndent\&#34;,\&#34;-1.6em\&#34;],\&#34;5\&#34;:[\&#34;pap-stylesheet-name\&#34;,\&#34;\&#34;],\&#34;6\&#34;:[\&#34;pap-list-level\&#34;,\&#34;0\&#34;],\&#34;7\&#34;:[\&#34;pap-list-template-id\&#34;,\&#34;9qj2k5\&#34;],\&#34;8\&#34;:[\&#34;author\&#34;,\&#34;p.144115217299900272\&#34;],\&#34;9\&#34;:[\&#34;list-text\&#34;,\&#34;○\&#34;],\&#34;10\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;2em\&#34;],\&#34;11\&#34;:[\&#34;pap-list-level\&#34;,\&#34;1\&#34;],\&#34;12\&#34;:[\&#34;list-text\&#34;,\&#34;■\&#34;],\&#34;13\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;4em\&#34;],\&#34;14\&#34;:[\&#34;pap-list-level\&#34;,\&#34;2\&#34;],\&#34;15\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;6em\&#34;],\&#34;16\&#34;:[\&#34;pap-list-level\&#34;,\&#34;3\&#34;],\&#34;17\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;8em\&#34;],\&#34;18\&#34;:[\&#34;pap-list-level\&#34;,\&#34;4\&#34;],\&#34;19\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;10em\&#34;],\&#34;20\&#34;:[\&#34;pap-list-level\&#34;,\&#34;5\&#34;],\&#34;21\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;12em\&#34;],\&#34;22\&#34;:[\&#34;pap-list-level\&#34;,\&#34;6\&#34;],\&#34;23\&#34;:[\&#34;pap-left-indent\&#34;,\&#34;14em\&#34;],\&#34;24\&#34;:[\&#34;pap-list-level\&#34;,\&#34;7\&#34;],\&#34;25\&#34;:[\&#34;pap-list-template-id\&#34;,\&#34;oz94x2\&#34;]},\&#34;nextNum\&#34;:26}}&#34;}],&#34;srcGlobalPadId&#34;:&#34;300000000$QEmToUoyPelv&#34;}" data-version="2.1.0"></melo-data></p>
<div>
<div class="document">
<div>
<div style="text-align: center;">
				<img decoding="async" alt="charles proxy" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy.png" style="text-align: center; width: 571px; height: 221px;" /></div>
<p>			查看Charles Proxy文章合集，请点击<a href="https://www.codelast.com/?p=13742" rel="noopener" target="_blank">这里</a>。</p>
<blockquote>
<p>
					Charles Proxy是一个HTTP代理/HTTP监视器/反向代理，它使开发人员能够查看其计算机和Internet之间的所有HTTP和SSL/HTTPS流量。这包括请求、响应和HTTP headers（其中包含cookie和缓存信息）。</p>
</blockquote>
<p>
			话不多说，直接按如下步骤操作：<br />
			➤ 导出Charles的证书</p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">在Charles界面上点击菜单导出 .pem 证书：</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(255, 0, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">Help</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">&#8594;</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(255, 0, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">SSL Proxying</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">&#8594;</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(255, 0, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">Save Charles Root Certificate</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">把文档保存到&#160;</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">~/charles.pem</span></p>
<p><span id="more-13392"></span>			<br />
			➤&#160;把Charles的key导入到JVM中</p></div>
<blockquote>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(64, 62, 214); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">cd /opt/jdk/bin</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(64, 62, 214); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">sudo keytool -import -alias charles -file </span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">~/charles.pem</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(64, 62, 214); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> -keystore /opt/jdk/jre/lib/security/cacerts -storepass changeit</span></p>
</blockquote>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">其中：<br />
			我的JDK是安装在 /opt/jdk 目录下，视实际情况更改。​</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">changeit</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> 是 cacerts 文件中的默认密码；</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">-alias cha</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">rles</span><span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> 是指定导入条目的别名；</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;PingFang SC&#34;, &#34;Microsoft YaHei&#34;, &#34;Source Han Sans SC&#34;, &#34;Noto Sans CJK SC&#34;, &#34;WenQuanYi Micro Hei&#34;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">charles.pem</span></p></div></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%8a%93%e5%8c%85%e6%9c%ac%e5%9c%b0java%e7%a8%8b%e5%ba%8f%e6%95%b0%e6%8d%ae%e9%85%8d%e7%bd%ae/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p><melo-data data-src="{&quot;mainAtext&quot;:&quot;{\&quot;atext\&quot;:{\&quot;attribs\&quot;:\&quot;*0+c*1*2*3*4*5*0+1*0+q*1*0+1*0*6+4*0*7+1*0*6+c*0*7+1*0*6+t*1*0+1*0+7*0*8+d*1*0+2*0+j*9*3*a*5*0+1*0*b+f*c*3*5*0*b+1*0*b+16*0*8+d*0*b+1s*c*3*5*0*b+1*0+3*d*3*5*0+1*0*e*8+8*0*e+k*d*3*5*0*e+1*0*8+a*0*e*8+4*0*e+c*d*3*5*0+1*0*e*8+b*0*e+d*d*3*5*0*e+1*0*e*8+7*0*e+q*d*3*5*0*e+1*0*e+x*0*e*6+1*0*e+j*f*0*e+2\&quot;,\&quot;text\&quot;:\&quot;导出Charles的证书\\n在Charles界面上点击菜单导出 .pem 证书：\\nHelp→SSL Proxying→Save Charles Root Certificate\\n把文档保存到 ~/charles.pem\\n\\n把Charles的key导入到JVM中\\ncd /opt/jdk/bin\\nsudo keytool -import -alias charles -file ~/charles.pem -keystore /opt/jdk/jre/lib/security/cacerts -storepass changeit\\n其中：\\nchangeit 是 cacerts 文件中的默认密码；\\n-alias charles 是指定导入条目的别名；\\ncharles.pem 是上一步导出的证书文件；\\nkeytool 是 /opt/jdk/bin/ 目录下的一个程序。\\n最后会询问“是否信任此证书? ”，如果是中文的问题，输入中文 的“是”之后会提示“证书已添加到密钥库中”。\\n\\n\&quot;},\&quot;apool\&quot;:{\&quot;numToAttrib\&quot;:{\&quot;0\&quot;:[\&quot;author\&quot;,\&quot;p.144115217299900272\&quot;],\&quot;1\&quot;:[\&quot;pap-stylesheet-name\&quot;,\&quot;normal\&quot;],\&quot;2\&quot;:[\&quot;pap-list-id\&quot;,\&quot;wvgrl5\&quot;],\&quot;3\&quot;:[\&quot;pap-list-level\&quot;,\&quot;0\&quot;],\&quot;4\&quot;:[\&quot;pap-list-template-id\&quot;,\&quot;9qj2k5\&quot;],\&quot;5\&quot;:[\&quot;pap-list-task\&quot;,\&quot;\&quot;],\&quot;6\&quot;:[\&quot;color\&quot;,\&quot;#FF0000\&quot;],\&quot;7\&quot;:[\&quot;color\&quot;,\&quot;rgb(0,0,0)\&quot;],\&quot;8\&quot;:[\&quot;color\&quot;,\&quot;rgb(231,82,0)\&quot;],\&quot;9\&quot;:[\&quot;pap-list-id\&quot;,\&quot;cpe9c0\&quot;],\&quot;10\&quot;:[\&quot;pap-list-template-id\&quot;,\&quot;oz94x2\&quot;],\&quot;11\&quot;:[\&quot;color\&quot;,\&quot;rgb(64,62,214)\&quot;],\&quot;12\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;0em\&quot;],\&quot;13\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;0pt\&quot;],\&quot;14\&quot;:[\&quot;font-family\&quot;,\&quot;\\\&quot;Helvetica Neue\\\&quot;,Helvetica,\\\&quot;PingFang SC\\\&quot;,\\\&quot;Microsoft YaHei\\\&quot;,\\\&quot;Source Han Sans SC\\\&quot;,\\\&quot;Noto Sans CJK SC\\\&quot;,\\\&quot;WenQuanYi Micro Hei\\\&quot;,sans-serif\&quot;],\&quot;15\&quot;:[\&quot;snapToGrid\&quot;,\&quot;1\&quot;]},\&quot;nextNum\&quot;:16}}&quot;,&quot;storyAtexts&quot;:[{&quot;storyId&quot;:&quot;LSTTMP&quot;,&quot;atext&quot;:&quot;{\&quot;atext\&quot;:{\&quot;attribs\&quot;:\&quot;*0*1*2*3*4*5*6*7*8+1*0*9*2*a*4*5*b*7*8+1*0*c*2*d*4*5*e*7*8+1*0*1*2*f*4*5*g*7*8+1*0*9*2*h*4*5*i*7*8+1*0*c*2*j*4*5*k*7*8+1*0*1*2*l*4*5*m*7*8+1*0*9*2*n*4*5*o*7*8+1*0*1*2*3*4*5*6*p*8+1*0*9*2*a*4*5*b*p*8+1*0*c*2*d*4*5*e*p*8+1*0*1*2*f*4*5*g*p*8+1*0*9*2*h*4*5*i*p*8+1*0*c*2*j*4*5*k*p*8+1*0*1*2*l*4*5*m*p*8+1*0*9*2*n*4*5*o*p*8+1\&quot;,\&quot;text\&quot;:\&quot;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\&quot;},\&quot;apool\&quot;:{\&quot;numToAttrib\&quot;:{\&quot;0\&quot;:[\&quot;list-start\&quot;,\&quot;0\&quot;],\&quot;1\&quot;:[\&quot;list-text\&quot;,\&quot;●\&quot;],\&quot;2\&quot;:[\&quot;list-format\&quot;,\&quot;bullet\&quot;],\&quot;3\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;0em\&quot;],\&quot;4\&quot;:[\&quot;pap-specialIndent\&quot;,\&quot;-1.6em\&quot;],\&quot;5\&quot;:[\&quot;pap-stylesheet-name\&quot;,\&quot;\&quot;],\&quot;6\&quot;:[\&quot;pap-list-level\&quot;,\&quot;0\&quot;],\&quot;7\&quot;:[\&quot;pap-list-template-id\&quot;,\&quot;9qj2k5\&quot;],\&quot;8\&quot;:[\&quot;author\&quot;,\&quot;p.144115217299900272\&quot;],\&quot;9\&quot;:[\&quot;list-text\&quot;,\&quot;○\&quot;],\&quot;10\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;2em\&quot;],\&quot;11\&quot;:[\&quot;pap-list-level\&quot;,\&quot;1\&quot;],\&quot;12\&quot;:[\&quot;list-text\&quot;,\&quot;■\&quot;],\&quot;13\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;4em\&quot;],\&quot;14\&quot;:[\&quot;pap-list-level\&quot;,\&quot;2\&quot;],\&quot;15\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;6em\&quot;],\&quot;16\&quot;:[\&quot;pap-list-level\&quot;,\&quot;3\&quot;],\&quot;17\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;8em\&quot;],\&quot;18\&quot;:[\&quot;pap-list-level\&quot;,\&quot;4\&quot;],\&quot;19\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;10em\&quot;],\&quot;20\&quot;:[\&quot;pap-list-level\&quot;,\&quot;5\&quot;],\&quot;21\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;12em\&quot;],\&quot;22\&quot;:[\&quot;pap-list-level\&quot;,\&quot;6\&quot;],\&quot;23\&quot;:[\&quot;pap-left-indent\&quot;,\&quot;14em\&quot;],\&quot;24\&quot;:[\&quot;pap-list-level\&quot;,\&quot;7\&quot;],\&quot;25\&quot;:[\&quot;pap-list-template-id\&quot;,\&quot;oz94x2\&quot;]},\&quot;nextNum\&quot;:26}}&quot;}],&quot;srcGlobalPadId&quot;:&quot;300000000$QEmToUoyPelv&quot;}" data-version="2.1.0"></melo-data></p>
<div>
<div class="document">
<div>
<div style="text-align: center;">
				<img decoding="async" alt="charles proxy" src="https://www.codelast.com/wp-content/uploads/2022/02/charles_proxy.png" style="text-align: center; width: 571px; height: 221px;" /></div>
<p>			查看Charles Proxy文章合集，请点击<a href="https://www.codelast.com/?p=13742" rel="noopener" target="_blank">这里</a>。</p>
<blockquote>
<p>
					Charles Proxy是一个HTTP代理/HTTP监视器/反向代理，它使开发人员能够查看其计算机和Internet之间的所有HTTP和SSL/HTTPS流量。这包括请求、响应和HTTP headers（其中包含cookie和缓存信息）。</p>
</blockquote>
<p>
			话不多说，直接按如下步骤操作：<br />
			➤ 导出Charles的证书</p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">在Charles界面上点击菜单导出 .pem 证书：</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(255, 0, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">Help</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">&rarr;</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(255, 0, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">SSL Proxying</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">&rarr;</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(255, 0, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">Save Charles Root Certificate</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">把文档保存到&nbsp;</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">~/charles.pem</span></p>
<p><span id="more-13392"></span>			<br />
			➤&nbsp;把Charles的key导入到JVM中</div>
<blockquote>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(64, 62, 214); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">cd /opt/jdk/bin</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
				<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(64, 62, 214); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">sudo keytool -import -alias charles -file </span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">~/charles.pem</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(64, 62, 214); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> -keystore /opt/jdk/jre/lib/security/cacerts -storepass changeit</span></p>
</blockquote>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">其中：<br />
			我的JDK是安装在 /opt/jdk 目录下，视实际情况更改。​</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">changeit</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> 是 cacerts 文件中的默认密码；</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">-alias cha</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">rles</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> 是指定导入条目的别名；</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">charles.pem</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> 是上一步导出的证书文件；</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(231, 82, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">keytool</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;"> 是 /opt/jdk/bin/ 目录下的一个程序。</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">最后会询问&ldquo;是否信任此证书? &rdquo;，如果是中文的问题，输入中文 的&ldquo;</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(255, 0, 0); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">是</span><span style="font-size: 11pt; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; letter-spacing: 0pt; vertical-align: baseline;">&rdquo;之后会提示&ldquo;证书已添加到密钥库中&rdquo;。</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.3; margin-top: 4px; margin-bottom: 4px;">
			<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
			➤&nbsp;在Java程序中使用Charles软件里定义的HTTP Proxy（即Charles默认8888端口的那个代理）<br />
			程序怎么写就不在这里讲了。</p>
</p></div>
</div>
<p>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：<br />
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; width: 200px; height: 200px;" /><br />
	以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-charles-proxy%e6%8a%93%e5%8c%85%e6%9c%ac%e5%9c%b0java%e7%a8%8b%e5%ba%8f%e6%95%b0%e6%8d%ae%e9%85%8d%e7%bd%ae/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
