Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
amitra0503 opened this issue Aug 2, 2018 · 1 comment

Comments

@amitra0503
Copy link

Whenever i am trying to query the device i get the below error

get_vpc(switch)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/pycsco/nxos/utils/nxapi_lib.py", line 1686, in get_vpc
data = device.show(command)
File "/usr/lib/python2.7/site-packages/pycsco/nxos/device.py", line 111, in show
data = self.sw1.send_req()
File "/usr/lib/python2.7/site-packages/pycsco/nxos/nxapi.py", line 287, in send_req
return req.get_resp(self.req_to_string(), self.cookie, self.timeout)
File "/usr/lib/python2.7/site-packages/pycsco/nxos/nxapi.py", line 141, in get_resp
timeout=timeout)) as resp:
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 469, in error
result = self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 656, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib64/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 1258, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)>

Here is the switch input

switch = Device(ip='actual i.p.',username='username',password='password')

@BobbyGR
Copy link
Contributor

BobbyGR commented Aug 2, 2018

Quick Fix: disable_ssl_certificate_validation=True

Example: http://thomas-cokelaer.info/blog/2016/01/python-certificate-verified-failed/

Real Fix: update your OS' certificate database
https://www.python.org/dev/peps/pep-0476/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants