Search code examples
internet-explorerseleniumsslselenium-webdriverbrowsermob-proxy

Cannot open https site in IE when user BrowserMob proxy with Selenium


Cannot open https page in IE11 with browserMob and selenium. Getting error "There is a problem with this website security certificate".

In Chrome it works although there is a warning in details of SSL certificate "This certificate cannot be verified up to a trusted certification authority".(Certificate error There are issues with the site's certificate chain (net::ERR_CERT_AUTHORITY_INVALID). )

Looks like browserMob changes ssl certificate issuer.

1) We have set driver to accept certificates capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

2) removed all possible security settings in IE settings (like "Check for publisher's/server certificate revocation"))..

3) Site url is added to trusted websites.

but nothing helps.

Does anyone know a solution for this issue? thanks!


Solution

  • The reason you're getting certificate errors is because BrowserMob Proxy "man-in-the-middles" HTTPS requests so that it can inspect, log, and manipulate them. In order to do that, BMP has to terminate SSL and re-encrypt using its own private key.

    Theoretically, setting CapabilityType.ACCEPT_SSL_CERTS to true should fix the warning. If it doesn't, it's possible that the IE driver doesn't respect that setting.

    As an alternative, you could install BMP's root CA into the Windows trust store on the same system that IE is running on. The BMP readme contains links to BMP's default CA. However, it's much safer to generate your own CA private key and certificate and install that into the Windows trust store, and instruct BMP to use that custom key and certificate. You can find instructions on generating your own keys/certs in BMP's MITM module documentation.