PythonDev
PythonDev

Reputation: 51

Selenium-Wire Your Connection Is Not Secure

I'm using selenium-wire with undetectable chromedriver and it's giving me: "Your Connection To This Site Is Not Secure" when I go into a site, and the https in the website address is crossed over, and it's saying that the certificate is invalid. The website's certificate is, however, not invalid. When I go into the website on my normal browser, it works as it should. I have noticed this happening on all https websites, i.e. https://httpbin.org/headers and https://google.com/, etc.

import seleniumwire.undetected_chromedriver as uc
if __name__ == '__main__':
    options = uc.ChromeOptions()
    driver = uc.Chrome(
        options=options,
        seleniumwire_options={}
    )

    driver.get('https://httpbin.org/headers')

This doesn't give me a popup or anything and I can still use the site normally, but I would like to get it fixed.
How can I go about fixing this?

Upvotes: 3

Views: 18540

Answers (3)

Loïc Madiès
Loïc Madiès

Reputation: 337

Using python -m seleniumwire extractcert and setup chrome browser is the good approach. But if you want to automate this, you can also run:

*Nix

certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "Selenium Wire" -i /path/to/ca.crt

Windows

certutil -addstore -f "Root" /path/to/ca.crt

To pragmatically fix the certificate issue without having to manually edit chrome setup.

Upvotes: 2

Faizan Ali
Faizan Ali

Reputation: 143

Install the certificate in chrome. You can get the certificate using python -m seleniumwire extractcert or you can download that from https://raw.githubusercontent.com/wkeeling/selenium-wire/master/seleniumwire/proxy/ca.crt How to install the certificate.

  • Open Chrome settings
  • Search Manage Certificates and open that
  • Click on “Trusted Root Certification Authorities”
  • Import the certificate you just have downloaded.

Upvotes: 12

Related Questions