wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.9k stars 254 forks source link

Multiple Instances of OpenSSL open up #29

Closed arunabhdas1 closed 3 years ago

arunabhdas1 commented 5 years ago

We have observed that multiple Instances of OpenSSL open up while the site is loading and subsequently we see "OSError: Tunnel Connection failed: 403 Forbidden" error in the logs.

Is this expected behavior of Selenium wire?

wkeeling commented 5 years ago

@runabh - how many instances are you seeing? Selenium Wire uses OpenSSL to generate the certificates when first connecting to a remote host over HTTPS. However, subsequent connections to the same host won't trigger OpenSSL again as they will reuse those certificates.

Can you let me know some details of your environment/test setup. Which OS are you using - Windows? And are you connecting directly to the remote host, or via an upstream proxy server (have you configured Selenium Wire's proxy settings)?

arunabhdas1 commented 5 years ago

@wkeeling - We are seeing 3 instances of OpenSSL triggered. We are running the code on Windows Server 2016. Chrome version - 59.0.307 (We've tried the latest version as well) We are using a proxy server to connect to the website and have configured the same in the code.

The site does open up, but there is a long delay as the OpenSSL popups take a lot of time.

The behavior is replicable on Firefox as well. We couldn't try Edge as it is on supported on the OS.

arunabhdas1 commented 5 years ago

This is the code

from seleniumwire import webdriver from seleniumwire.webdriver import ChromeOptions import time options = { 'https': 'proxy detail', 'disable_encoding': True } browser = webdriver.Chrome(seleniumwire_options = options) browser.header_overrides = { 'Cookie': 'cookie string' }

browser.get('url')

wkeeling commented 5 years ago

Thanks @runabh . This sounds similar to #26 where the site is slow to load in Windows, and likely caused by OpenSSL. I will do some investigation and see how we can improve the performance.

aislaks commented 4 years ago

I have also faced the same issue where I am getting "OSError: Tunnel Connection failed: 403 Forbidden" error in the logs.

DGaffney commented 3 years ago

Also seeing ≈30 of these in quick sequence on Youtube

wkeeling commented 3 years ago

Closing, as from version 4 Selenium Wire no longer uses the openssl executable for certificate generation. However, if similar behaviour is seen in v4 then the issue can be reopened.