I am trying to connect securely to a website that has a valid SSL certificate. However, when I connect using Selenium the Chrome browser says the connection is insecure. If I click on the "Not secure" flag in the url bar, it says "Your connection to this site is not secure." If I click on the link below this which says Certificate (Invalid) this opens up a new window with details on the certificate which say "This certificate is valid." How am I supposed to understand this nonsensical discrepancy?
I can connect to some sites securely. For example, connecting to https://www.google.com does not cause the same problem. The site I am having problems with is using a certificate from LetsEncrypt. I really don't know whether this problem is has anything to do with that but what's wrong with the cert or why does Selenium have a problem with it?
Incidentally, I can get Selenium to ignore the error using the "ignore-certificate-errors" flag in the driver options. But this leads to problems down the road when I try to authenticate. So it's not a solution.
The code I am using is basically this with the url and path replaced:
driver = webdriver.Chrome('/path/chromedriver')
driver.get('https://xxx')