本文介绍了为什么我从Google adwords api收到CERTIFICATE_VERIFY_FAILED?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Google adwords api会在此链接停止播放:

Why google adwords api stops on call this link:

https://adwords.google.com/api/adwords/mcm/v201502/CustomerService?wsdl

有了这个错误 - 我应该在之前加载一些证书吗?

With this error - should I load some certificate before and how?

urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

使用Python 2.7.10。

Using Python 2.7.10.

完整源代码:

完整的错误代码:

Full error code:

Traceback (most recent call last):
  File "C:/Users/Crezary Wagner/PycharmProjects/learn-adwords/src/examples/create_adwords_client_without_yaml.py", line 56, in <module>
    CLIENT_CUSTOMER_ID)
  File "C:/Users/Crezary Wagner/PycharmProjects/learn-adwords/src/examples/create_adwords_client_without_yaml.py", line 50, in main
    customer = adwords_client.GetService('CustomerService').get()
  File "C:\root\Python27\lib\site-packages\googleads\adwords.py", line 256, in GetService
    proxy=proxy_option, cache=self.cache, timeout=3600)
  File "C:\root\Python27\lib\site-packages\suds\client.py", line 115, in __init__
    self.wsdl = reader.open(url)
  File "C:\root\Python27\lib\site-packages\suds\reader.py", line 150, in open
    d = self.fn(url, self.options)
  File "C:\root\Python27\lib\site-packages\suds\wsdl.py", line 136, in __init__
    d = reader.open(url)
  File "C:\root\Python27\lib\site-packages\suds\reader.py", line 74, in open
    d = self.download(url)
  File "C:\root\Python27\lib\site-packages\suds\reader.py", line 92, in download
    fp = self.options.transport.open(Request(url))
  File "C:\root\Python27\lib\site-packages\suds\transport\https.py", line 62, in open
    return HttpTransport.open(self, request)
  File "C:\root\Python27\lib\site-packages\suds\transport\http.py", line 67, in open
    return self.u2open(u2request)
  File "C:\root\Python27\lib\site-packages\suds\transport\http.py", line 132, in u2open
    return url.open(u2request, timeout=tm)
  File "C:\root\Python27\lib\urllib2.py", line 431, in open
    response = self._open(req, data)
  File "C:\root\Python27\lib\urllib2.py", line 449, in _open
    '_open', req)
  File "C:\root\Python27\lib\urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "C:\root\Python27\lib\urllib2.py", line 1240, in https_open
    context=self._context)
  File "C:\root\Python27\lib\urllib2.py", line 1197, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>


推荐答案

Python使用'system ssl certificate store'中的证书验证https连接,如果没有任何适当的SSL证书存储错误发生像这样。
下载ssl证书(在浏览器中打开您的https链接,然后单击地址栏中的锁定图标>更多信息>查看证书>详细信息>导出),然后将其安装到您的系统中,如此链接

Python uses certificates from 'system ssl certificate store' to certify https connection, if there is not any appropriate ssl cert in the store error occurs like this.Download ssl certificate (Open your https link in browser and click lock icon in address bar > More Information > View Certificate > Details > Export) and install it on your system as stated this link http://windows.microsoft.com/en-us/windows/import-export-certificates-private-keys#1TC=windows-7

这篇关于为什么我从Google adwords api收到CERTIFICATE_VERIFY_FAILED?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 18:01