Open zouhir opened 4 years ago
@zouhir I want to make sure I understand the flow here, since I'm unfamiliar with Saucelabs. My understanding is that you have a copy of WPT, and a copy of Selenium running on the localhost (e.g. your desktop). Selenium is then controlling a browser that is running inside a VM in the Saucelabs CI system, and it ultimately is pointing that browser at test files that are... where? Is there a separate copy of WPT running inside Saucelabs, or is it loading them from your desktop as well?
The above may not exactly impact on this bug, but I want to make sure I understand the setup when trying to figure out what may be going wrong.
I think the main thing will be to figure out if Saucelabs is serving us a valid SSL cert. I'm no SSL expert (cc @Hexcles who may be able to help), but I used the following command:
echo | openssl s_client -showcerts -servername ondemand.us-west-1.saucelabs.com -connect ondemand.us-west-1.saucelabs.com:443 2>/dev/null | openssl x509 -inform pem -noout -text
I've attached the resulting cert. At first glance, it looks ok? sauce-labs-cert.txt
Also, are you able to test the Selenium relay and see if that works? This looks to be what the code was originally doing, since it used localhost
and port 4445
- see https://wiki.saucelabs.com/display/DOCS/Using+the+Selenium+Relay+with+Sauce+Connect+Proxy#UsingtheSeleniumRelaywithSauceConnectProxy-SettingUpYourTeststoUsetheSeleniumRelay . Note that that page specifically mentions problems with Selenium + Python 2.7 + SSL certs.
The server cert looks good to me.
Are you running on macOS by the way?
Could you try in Python 2:
r = urllib3.PoolManager().request('GET', 'https://ondemand.us-west-1.saucelabs.com')
print r.data
and see if there's any error?
@Hexcles using my current device & python 2.7.16, I currently get from the snippet above:
{"ready":true,"message":"Sauce Labs automated testing is fully operational"}
Yet in the same environment you got the stacktrace above? That's really not expected and I don't have any great clue at the moment.
Would it be exactly the same environment? In the wpt case we'd be using our virtualenv I guess?
@zouhir were you able to make any progress on this? What was the command line you tried? We used to run WPT over Sauce Labs for wpt.fyi so this code has definitely worked at one point, but it might have bitrotted since we stopped doing that. (All runs are now performed directly on the VMs with the browsers.)
Saucelabs provided me with the following URL to create a test:
https://<sauce_user>:<sauce_key>@ondemand.us-west-1.saucelabs.com:443/wd/hub
WPT's sauce runner is unable to connect to that URL, and it throws the following error:
This issue is not too rare in selenium-web driver world, and usually people attempt to do the following for situations of self-signed certs, I tried but no luck:
1- Changes in the capabilities object: In the following capabilities object, we can ask Webdriver to be OK with self-signed certs: https://github.com/web-platform-tests/wpt/blob/d3ea88514a93b7b69687837de19b1ca6da15cf91/tools/wptrunner/wptrunner/browsers/sauce.py#L58
2- changes to Sauceconnect args passing the "--no-ssl-bump-domains=all" flag to the binary executor command in will not result in any change. https://github.com/web-platform-tests/wpt/blob/d3ea88514a93b7b69687837de19b1ca6da15cf91/tools/wptrunner/wptrunner/browsers/sauce.py#L168
Here's a stacktrace dump: