<?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/%E8%AF%81%E4%B9%A6/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Thu, 17 Feb 2022 16:05:03 +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>[原创] 使用Selenium Wire访问网站时提示&quot;您与此网站之间建立的连接不安全&quot;的解决办法</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8selenium-wire%e8%ae%bf%e9%97%ae%e7%bd%91%e7%ab%99%e6%97%b6%e6%8f%90%e7%a4%ba%e6%82%a8%e4%b8%8e%e6%ad%a4%e7%bd%91%e7%ab%99%e4%b9%8b%e9%97%b4%e5%bb%ba%e7%ab%8b/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8selenium-wire%e8%ae%bf%e9%97%ae%e7%bd%91%e7%ab%99%e6%97%b6%e6%8f%90%e7%a4%ba%e6%82%a8%e4%b8%8e%e6%ad%a4%e7%bd%91%e7%ab%99%e4%b9%8b%e9%97%b4%e5%bb%ba%e7%ab%8b/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 15 Feb 2022 12:46:31 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Selenium Wire]]></category>
		<category><![CDATA[信任]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[证书]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=13517</guid>

					<description><![CDATA[<p>本文针对的操作系统：Ubuntu / MacOS</p>
<p>这个问题是由于<span style="background-color: rgb(255, 255, 255); font-family: &#34;JetBrains Mono&#34;, &#34;Droid Sans Mono&#34;, &#34;monospace&#34;, monospace; font-size: 16px; white-space: pre;">Selenium Wire</span>使用了自己的证书来访问网站，而它的证书默认不受Chrome信任。<br />
在Chrome里查看证书可以看到：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/selenium_wire_ca_info.png" style="width: 263px; height: 107px;" /></a><br />
<span id="more-13517"></span><br />
解决办法：<br />
➤ 导出<span style="font-family: &#34;JetBrains Mono&#34;, &#34;Droid Sans Mono&#34;, &#34;monospace&#34;, monospace; font-size: 16px; white-space: pre; background-color: rgb(255, 255, 255);">Selenium Wire的</span>证书文件<br />
在安装<span style="font-family: &#34;JetBrains Mono&#34;, &#34;Droid Sans Mono&#34;, &#34;monospace&#34;, monospace; font-size: 16px; white-space: pre; background-color: rgb(255, 255, 255);">Selenium Wire的Python环境里执行：</span></p>
<blockquote>
<p>
		python -m seleniumwire extractcert</p>
</blockquote>
<p>成功的话，会在当前目录下生成 ca.crt 证书文件。<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 />
➤ 把证书导入Chrome<br />
✔ 对Ubuntu系统（其他Linux发行版应该类似，我没有用过），依次打开Chrome的如下页面（以下操作过程都在Chrome浏览器内部完成，不会跳转到操作系统的任何设置对话框里）：<br />
&#8220;<span style="color:#0000ff;">设置</span>&#8221;&#8594;&#8220;<span style="color:#0000ff;">安全和隐私设置</span>&#8221;&#8594;&#8220;<span style="color:#0000ff;">安全</span>&#8221;&#8594;&#8220;<span style="color:#ff0000;">管理证书</span>&#8221;&#8594;&#8220;<span style="color:#ff0000;">授权机构</span>&#8221;<br />
点击&#8220;导入&#8221;按钮，选择刚才生成的证书文件，会弹出下面的对话框：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/chrome_ca_auth_center.png" style="width: 518px; height: 311px;" /><br />
只勾选红框的那一项再点击&#8220;确定&#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>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8selenium-wire%e8%ae%bf%e9%97%ae%e7%bd%91%e7%ab%99%e6%97%b6%e6%8f%90%e7%a4%ba%e6%82%a8%e4%b8%8e%e6%ad%a4%e7%bd%91%e7%ab%99%e4%b9%8b%e9%97%b4%e5%bb%ba%e7%ab%8b/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>本文针对的操作系统：Ubuntu / MacOS</p>
<p>这个问题是由于<span style="background-color: rgb(255, 255, 255); font-family: &quot;JetBrains Mono&quot;, &quot;Droid Sans Mono&quot;, &quot;monospace&quot;, monospace; font-size: 16px; white-space: pre;">Selenium Wire</span>使用了自己的证书来访问网站，而它的证书默认不受Chrome信任。<br />
在Chrome里查看证书可以看到：<br />
<a href="https://www.codelast.com/" rel="noopener" target="_blank"><img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/selenium_wire_ca_info.png" style="width: 263px; height: 107px;" /></a><br />
<span id="more-13517"></span><br />
解决办法：<br />
➤ 导出<span style="font-family: &quot;JetBrains Mono&quot;, &quot;Droid Sans Mono&quot;, &quot;monospace&quot;, monospace; font-size: 16px; white-space: pre; background-color: rgb(255, 255, 255);">Selenium Wire的</span>证书文件<br />
在安装<span style="font-family: &quot;JetBrains Mono&quot;, &quot;Droid Sans Mono&quot;, &quot;monospace&quot;, monospace; font-size: 16px; white-space: pre; background-color: rgb(255, 255, 255);">Selenium Wire的Python环境里执行：</span></p>
<blockquote>
<p>
		python -m seleniumwire extractcert</p>
</blockquote>
<p>成功的话，会在当前目录下生成 ca.crt 证书文件。<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 />
➤ 把证书导入Chrome<br />
<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;" /> 对Ubuntu系统（其他Linux发行版应该类似，我没有用过），依次打开Chrome的如下页面（以下操作过程都在Chrome浏览器内部完成，不会跳转到操作系统的任何设置对话框里）：<br />
&ldquo;<span style="color:#0000ff;">设置</span>&rdquo;&rarr;&ldquo;<span style="color:#0000ff;">安全和隐私设置</span>&rdquo;&rarr;&ldquo;<span style="color:#0000ff;">安全</span>&rdquo;&rarr;&ldquo;<span style="color:#ff0000;">管理证书</span>&rdquo;&rarr;&ldquo;<span style="color:#ff0000;">授权机构</span>&rdquo;<br />
点击&ldquo;导入&rdquo;按钮，选择刚才生成的证书文件，会弹出下面的对话框：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/chrome_ca_auth_center.png" style="width: 518px; height: 311px;" /><br />
只勾选红框的那一项再点击&ldquo;确定&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 />
<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;" />&nbsp;对MacOS，当你按照上面的步骤点击了&ldquo;<span style="color: rgb(255, 0, 0);">管理证书</span>&rdquo;时，会发现Mac自动打开了系统的&ldquo;钥匙串访问&rdquo;设置对话框，也就是说你不能像在Ubuntu系统里一样只在Chrome里就能设置好。<br />
此时，按照如下步骤去设置：<br />
把前面生成的 ca.crt&nbsp;文件拖入&ldquo;钥匙串访问&rdquo;对话框，会要你输入密码把Selenium Wire的证书导入，之后就会看到导入的证书不被信任：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/mac_selenium_ca_untrusted_1.png" style="width: 600px; height: 344px;" /></p>
<p>双击它也会进一步看到不被信任：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/mac_selenium_ca_untrusted_2.png" style="width: 500px; height: 361px;" /></p>
<p>展开&ldquo;信任&rdquo;前的箭头，把&ldquo;使用此证书时&rdquo;改成&ldquo;始终信任&rdquo;：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/mac_selenium_ca_trusted_1.png" style="width: 400px; height: 448px;" /></p>
<p>关闭对话框，会要求你输入密码确认，之后就会看到证书已被信任：<br />
<img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2022/02/mac_selenium_ca_trusted_2.png" style="width: 600px; height: 376px;" /></p>
<p>现在再试试，<span style="font-family: &quot;JetBrains Mono&quot;, &quot;Droid Sans Mono&quot;, &quot;monospace&quot;, monospace; font-size: 16px; white-space: pre; background-color: rgb(255, 255, 255);">Selenium Wire不会再出现之前的不安全提示啦。</span><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>&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-%e4%bd%bf%e7%94%a8selenium-wire%e8%ae%bf%e9%97%ae%e7%bd%91%e7%ab%99%e6%97%b6%e6%8f%90%e7%a4%ba%e6%82%a8%e4%b8%8e%e6%ad%a4%e7%bd%91%e7%ab%99%e4%b9%8b%e9%97%b4%e5%bb%ba%e7%ab%8b/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
