Closed axgdev closed 3 years ago
Thanks for raising this. The documentation did have a step for installing OpenSSL, but it was recently removed in version 3.0.0 as I thought OpenSSL was installed on most systems by default - but it seems that's not the case. I'll add that step back in.
Out of curiosity, what issue did you encounter when you tried to use LibreSSL?
The documentation has been updated to mention OpenSSL in v3.0.3 of Selenium Wire.
@wkeeling As you said, OpenSSL is probably installed in most systems by default, so my case is probably very rare. When I used libressl
, I got the same error as not having a SSL library at all. If you want to reproduce it, here is what I did.
docker run -d -p 4444:4444 --name selenium_firefox selenium/standalone-firefox:3.141.59-20201119
, this runs a container with ip address 172.17.0.2
in case no other container was running in the backgrounddocker run -it python:3.8-alpine sh
this runs a container with ip address 172.17.0.3
in case only the firefox selenium container was running in the backgroundapk add libressl
pip install selenium
pip install selenium-wire
from seleniumwire import webdriver
from selenium.webdriver import FirefoxProfile
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
firefoxDockerAddress = '172.17.0.2' firefoxDockerPort = '4444' dockerProxyAddress = '172.17.0.3'
driver = webdriver.Remote("http://{0}:{1}/wd/hub".format(firefoxDockerAddress, firefoxDockerPort), desired_capabilities=DesiredCapabilities.FIREFOX, seleniumwire_options={'addr': dockerProxyAddress, })
driver.get('https://google.com')
for r in driver.requests: print(r.path, r)
driver.quit()
And I got: Message: `Reached error page: about:neterror?e=nssFailure2&u=https%3A//google.com/&c=UTF-8&d=The%20connection%20to%20google.com%20was%20interrupted%20while%20the%20page%20was%20loading.`
If I replace the step 3 with `apk add openssl` then everything is fine.
First of all, thank you for the awesome library!
This is might very obvious but
selenium-wire
won't work properly with HTTPS sites without a SSL library installed in the system.I was using Alpine linux in docker and got this error when trying to load google.com:
Message: Reached error page: about:neterror?e=nssFailure2&u=https%3A//google.com/&c=UTF-8&d=The%20connection%20to%20google.com%20was%20interrupted%20while%20the%20page%20was%20loading.
The python Alpine linux docker image does not come with a SSL library installed. So to use
selenium-wire
you have to install a SSL library such as OpenSSL. Example:apk add openssl
Apparently
selenium-wire
does not seem to work withlibressl
, at least in Alpine Linux.