I have Kaspersky antivirus installed. When I run automated tests in dev environment, I get the warning

Connection not protected

The security of your connection is reduced. Criminals can attempt to steal your data from the website. You are advised to leave this website.

URL: ************


This certificate or the certificate chain is built on an untrusted root center. View certificate

I understand the risks and wish to continue

Obviously, I can make selenium click the "I understand the risks and wish to continue" link, but I'm interested if there are some other Selenium (or other test automation tools) tricks to circumvent this? Sort of like adding Selenium to Kaspersky whitelist.

  • Try to add this cert to trusted store
    – Alexey R.
    May 19 '20 at 10:05
  • How do I do that?
    – Mate Mrše
    May 19 '20 at 10:28
  • Are you using Windows OS? And which browser do you use?
    – Alexey R.
    May 19 '20 at 10:36
  • Windows 10 and Chrome.
    – Mate Mrše
    May 19 '20 at 10:41

Try the following:

  1. Click the "lock" icon near the URL in address bar
  2. Click "Certificate"
  3. Switch to "Details" tab
  4. Click "Copy to File..." button
  5. Follow the wizard steps. Save the cert to some file in X.509 format
  6. In file explorer right click that certificate file and choose "Install Certificate"
  7. Follow the steps of import wizard so that your certificate is installed for Current User or Local Machine (I think both would work). When you are asked if you need to place the cert to a certain store, choose that option and select Trusted Root
  8. Acknowledge all the warnings

This should be the solution.

UPD from Mate Mrše: If you have the chain of certificates, repeat the actions for all of the chain items.

  • It is not working. When I click on "view certificate" I get "This certificate cannot be verified up to a trusted certification authority."
    – Mate Mrše
    May 19 '20 at 11:09
  • I have tested my approach at badssl.com with self-signed case. Can you post couple of screenshot of the steps and errors?
    – Alexey R.
    May 19 '20 at 11:15
  • OK, it is working now. The certificate was under a root of another certificate so I needed to install them both to work.
    – Mate Mrše
    May 19 '20 at 11:25
  • 1
    An alternative is to use "full chain" certificates on your development servers, which requires only sharing the self-signed root cert and does not require installing all the intermediate authorities you create for yourself.
    – crasic
    May 19 '20 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.