pip install fails with ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

1,125 views
Skip to first unread message

Sander Pool

unread,
Jun 20, 2016, 10:39:11 PM6/20/16
to ibm_db

Hi,

I'm trying to install the driver for Python 3.4 on a linux system in our lab. Other pip installs have worked fine. This is one that fails:

[root@pools1-sc-vm /]# pip install ibm_db
Downloading/unpacking ibm-db
  Downloading ibm_db-2.0.7.tar.gz (553kB): 553kB downloaded
  Running setup.py (path:/tmp/pip_build_root/ibm-db/setup.py) egg_info for package ibm-db
    Detected 64-bit Python
    Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
    Traceback (most recent call last):
      File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 1182, in do_open
        h.request(req.get_method(), req.selector, req.data, headers)
      File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1088, in request
        self._send_request(method, url, body, headers)
      File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1126, in _send_request
        self.endheaders(body)
      File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1084, in endheaders
        self._send_output(message_body)
      File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 922, in _send_output
        self.send(msg)
      File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 857, in send
        self.connect()
      File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1231, in connect
        server_hostname=server_hostname)
      File "/opt/ActivePython-3.4/lib/python3.4/ssl.py", line 365, in wrap_socket
        _context=self)
      File "/opt/ActivePython-3.4/lib/python3.4/ssl.py", line 583, in __init__
        self.do_handshake()
      File "/opt/ActivePython-3.4/lib/python3.4/ssl.py", line 810, in do_handshake
        self._sslobj.do_handshake()
    ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/ibm-db/setup.py", line 159, in <module>
        file_stream = BytesIO(request.urlopen(url).read())
      File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 161, in urlopen
        return opener.open(url, data, timeout)
      File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 463, in open
        response = self._open(req, data)
      File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 481, in _open
        '_open', req)
      File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 441, in _call_chain
        result = func(*args)
      File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 1225, in https_open
        context=self._context, check_hostname=self._check_hostname)
      File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 1184, in do_open
        raise URLError(err)
    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
    Complete output from command python setup.py egg_info:
    Detected 64-bit Python

Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz

Traceback (most recent call last):

  File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 1182, in do_open

    h.request(req.get_method(), req.selector, req.data, headers)

  File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1088, in request

    self._send_request(method, url, body, headers)

  File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1126, in _send_request

    self.endheaders(body)

  File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1084, in endheaders

    self._send_output(message_body)

  File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 922, in _send_output

    self.send(msg)

  File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 857, in send

    self.connect()

  File "/opt/ActivePython-3.4/lib/python3.4/http/client.py", line 1231, in connect

    server_hostname=server_hostname)

  File "/opt/ActivePython-3.4/lib/python3.4/ssl.py", line 365, in wrap_socket

    _context=self)

  File "/opt/ActivePython-3.4/lib/python3.4/ssl.py", line 583, in __init__

    self.do_handshake()

  File "/opt/ActivePython-3.4/lib/python3.4/ssl.py", line 810, in do_handshake

    self._sslobj.do_handshake()

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/ibm-db/setup.py", line 159, in <module>

    file_stream = BytesIO(request.urlopen(url).read())

  File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 161, in urlopen

    return opener.open(url, data, timeout)

  File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 463, in open

    response = self._open(req, data)

  File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 481, in _open

    '_open', req)

  File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 441, in _call_chain

    result = func(*args)

  File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 1225, in https_open

    context=self._context, check_hostname=self._check_hostname)

  File "/opt/ActivePython-3.4/lib/python3.4/urllib/request.py", line 1184, in do_open

    raise URLError(err)

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

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/ibm-db
Storing debug log for failure in /root/.pip/pip.log



I was able to wget the failed package just fine but I can't find installation instructions. I hope that if I manually overcome this dependency the pip install will skip the failed step and proceed.

[root@pools1-sc-vm software]# wget https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
--2016-06-20 13:46:38--  https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
Resolving public.dhe.ibm.com... 170.225.15.112
Connecting to public.dhe.ibm.com|170.225.15.112|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18700692 (18M) [application/gzip]
Saving to: “linuxx64_odbc_cli.tar.gz”

100%[=========================================================================>] 18,700,692  1.85M/s   in 16s

2016-06-20 13:46:56 (1.12 MB/s) - “linuxx64_odbc_cli.tar.gz” saved [18700692/18700692]

[root@pools1-sc-vm software]# tar xvzf linuxx64_odbc_cli.tar.gz
clidriver/
clidriver/include/
clidriver/include/sqlda.h
<snip>

Any idea how to install this CLI package? The executables work but including them in my path doesn't seem to satisfy the dependency.

Thanks,

   Sander

Saba Kauser

unread,
Jun 20, 2016, 10:45:03 PM6/20/16
to ibm...@googlegroups.com, sande...@gmail.com
Install steps for ODBC and CLI Driver can be found here:
https://www-304.ibm.com/support/docview.wss?uid=swg21418043

Steps to install ibm_db with an already installed copy of cli driver is documented here:
https://www.ibm.com/developerworks/community/blogs/96960515-2ea1-4391-8170-b0515d08e4da/entry/Installing_Python_ibm_db_driver?lang=en

 you could set IBM_DB_HOME to the install location of the IBM DB2 ODBC Driver and issue easy_install or pip install or pip3 install.

  export IBM_DB_HOME=<path to clidriver>
  easy_install ibm_db


Regards
_________________________________________
Saba Kauser
DB2 Common Application Development
India Software Labs- IBM
Bangalore

--
You received this message because you are subscribed to the Google Groups "ibm_db" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ibm_db+un...@googlegroups.com.
To post to this group, send email to
ibm...@googlegroups.com.
Visit this group at
https://groups.google.com/group/ibm_db.
For more options, visit
https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages