擅长:python、mysql、java
<p><strong>不建议在组织的环境中使用<code>verify = False</code>。这实际上是在禁用SSL验证。</p>
<p>有时,当您在公司代理后面时,它会用代理的证书链替换证书链。在certifi使用的cacert.pem中添加证书可以解决此问题。我也有类似的问题。我是这么做的,为了解决这个问题-</p>
<ol>
<li>找到cacert.pem所在的路径-</li>
</ol>
<blockquote>
<p>Install certifi, if you don't have. Command: <code>pip install certifi</code></p>
</blockquote>
<pre><code>import certifi
certifi.where()
C:\\Users\\[UserID]\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\certifi\\cacert.pem
</code></pre>
<ol start=“2”>
<li><p>在浏览器上打开URL。从URL下载证书链并保存为Base64编码的.cer文件。</p></li>
<li><p>现在在记事本中打开cacert.pem,并在最后添加所有下载的证书内容(<code>---Begin Certificate--- *** ---End Certificate---</code>)。</p></li>
</ol>