I am trying to get data from the web using python. I imported urllib.request package for it but while executing, I get error:
certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)
When I changed the URL to 'http' - I am able to get data. But, I believe, this avoids checking SSL certificate.
So I checked on the internet and found one solution: Run /Applications/Python\ 3.7/Install\ Certificates.command
This solved my problem. But I have no knowledge on SSL and the likes. Can you help me understand what it actually did to solve my issue.
If possible, please recommend me any good resource to learn about the security and certificates. I am new to this.
Thanks!
Note: I did go through the link - openssl, python requests error: "certificate verify failed"
My question differs from the one in link because, I want to know what actually happens when I install certifi
package or run Install\ Certificates.command
to fix the error. I have a poor understanding of securities.
When ssl certificate problem unable to get local issuer certificate error is caused by a self-signed certificate, the fix is to add the certificate to the trusted certificate store. Open the file ca-bundle. crt located in the directory above, then copy and paste the Git SSL certificate to the end of the file.
To install certifi Python on Microsoft Windows: Type cmd in the search bar and hit Enter to open the command line. Type python3 -m pip install certifi in the command line and hit Enter again. This installs certifi for your default Python installation.
This error occur when self-signed certificate cannot be verified. By default the git verifies the self-signed certificate every time you push or pull the fixes to and from git server. By this command we tell the git not to perform validation of the certificate using global option.
For anyone who still wonders on how to fix this, i got mine by installing the "Install Certificates.command
"
Here is how I did,
Just double click on that file wait for it to install and in my case, you will be ready to go
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With