Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docker image SSL error when trying to install webdrivers #933

Answered by mdmintz
JeffVM-Solutions asked this question in Q&A
Discussion options

When trying to use the "seleniumbase install chromedriver" I keep getting a SSLCertVerificationError. I built the SeleniumBase image based on a ubuntu image created by my company with all SSL certs and proxies preset and correct. I can use apt-get and pip with no issues, so I am unsure what I'm missing to get this working.

You must be logged in to vote

@DevOps-Martins SeleniumBase v1.63.15 has been released, which includes an updated Dockerfile. That should address those issues.

Replies: 2 comments 5 replies

Comment options

Just as an FYI, I was able to manually install the webdrivers and run test successfully. Steps taken :
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz
tar -xvzf geckodriver-v0.24.0-linux32.tar.gz
chmod +x geckodriver
mv geckodriver /usr/local/bin

(Also added those commands to the dockerfile and worked as well)

RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz
RUN tar -xvzf geckodriver-v0.24.0-linux32.tar.gz
RUN chmod +x geckodriver
RUN mv geckodriver /usr/local/bin
RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip
RUN mv chromedriver /usr/bin/chromedriver
RUN chmod +x /usr/bin/chromedriver

You must be logged in to vote
4 replies
Comment options

@DevOps-Martins Out of curiosity, did Geckodriver v0.29.1 work for you and Chromedriver 2.44?
I can add those extra lines to the standard Dockerfile (and remove RUN seleniumbase install chromedriver and
RUN seleniumbase install geckodriver) after making the version updates, but it seems those lines are specific to your environment possibly? Did the Dockerfile work for you in the default environment?

Comment options

@DevOps-Martins Also, which line of SeleniumBase code did you receive the SSLCertVerificationError on? (Maybe that part can be fixed easily.)

Comment options

@mdmintz The most recent versions of the drivers did work. And the Dockerfile does work as expected in a "home lab" environment. My issue is I'm behind a lot of security layers at my job. I would say you can keep the original dockerfile and just add the manual way of doing it as a comment. Below is the error log (This is from within the docker container):

Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 964, in prepare_proxy
conn.connect()
File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 411, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl
.py", line 449, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl
.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chromedriver.storage.googleapis.com', port=443): Max retries exceeded with url: /LATEST_RELEASE (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/seleniumbase", line 33, in
sys.exit(load_entry_point('seleniumbase', 'console_scripts', 'seleniumbase')())
File "/SeleniumBase/seleniumbase/console_scripts/run.py", line 716, in main
sb_install.main()
File "/SeleniumBase/seleniumbase/console_scripts/sb_install.py", line 193, in main
url_req = requests.get(last)
File "/usr/local/lib/python3.8/dist-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='chromedriver.storage.googleapis.com', port=443): Max retries exceeded with url: /LATEST_RELEASE (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

Comment options

@DevOps-Martins I think I see the issue. It looks like the Python requests.get() on https://chromedriver.storage.googleapis.com/LATEST_RELEASE returns the SSLCertVerificationError from your server, but they also have an http version of the same URL: http://chromedriver.storage.googleapis.com/LATEST_RELEASE
If you're able to reproduce the issue on the https url, but not on the http version, then the fix would be rather easy for me to do. I could ship that in the next SeleniumBase release if you can verify that.

Comment options

@DevOps-Martins SeleniumBase v1.63.15 has been released, which includes an updated Dockerfile. That should address those issues.

You must be logged in to vote
1 reply
Comment options

Awesome! Thank you!

Answer selected by JeffVM-Solutions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /