pypsa-meets-earth / pypsa-earth-sec

GNU General Public License v3.0
19 stars 16 forks source link

Global industry dataset #221

Closed Eddy-JV closed 5 months ago

Eddy-JV commented 10 months ago

Closes #184 (if applicable).

Changes proposed in this Pull Request

Checklist

hazemakhalek commented 10 months ago

@Eddy-JV Do you have suggestions here?

Eddy-JV commented 10 months ago

It happened to me also some few times. But if I am not mistaken, it was solved by just running the script again. I guess I had some network issues.

@hazemakhalek is it running in your environment?

In general: The ssl.SSLError with the message "[SSL: CERTIFICATE_VERIFY_FAILED]" indicates that there's a problem with verifying the SSL certificate of the server you're trying to connect to. This can happen if the server's SSL certificate is not recognized as valid by your Python environment.

Here are a few steps you can take to troubleshoot and resolve this issue:

  1. Update Your CA Certificates: Make sure your system's CA (Certificate Authority) certificates are up-to-date. This can be done by updating your operating system's package manager or by manually updating the CA certificates.

  2. Check System Time and Date: Incorrect system time and date settings can lead to SSL verification errors. Ensure that your system's time and date settings are correct.

  3. Verify the Server's SSL Certificate: Manually check if the SSL certificate of the server you're trying to connect to is valid. You can do this using a web browser or command-line tools like OpenSSL.

  4. Add SSL Certificates to Python: If the server is using a self-signed certificate or a custom certificate authority, you might need to add the server's certificate to Python's certificate store. You can do this by using the certifi library:

pip install certifi

Then, in your code, set the SSL certificate file using:

import certifi
import ssl

ssl_context = ssl.create_default_context(cafile=certifi.where())

Pass ssl_context to your requests or other networking libraries.

  1. Disable SSL Verification (Not Recommended): While it's not recommended for security reasons, you can disable SSL verification temporarily for testing purposes by passing verify=False to your request. However, this approach should not be used in production.
import requests

response = requests.get(url, verify=False)
  1. Check Proxy Settings: If you're behind a corporate firewall or using a proxy, it could be intercepting SSL traffic. Ensure your proxy settings are correctly configured.

  2. Check Antivirus/Firewall: Some antivirus or firewall software might interfere with SSL connections. Temporarily disabling such software (if safe) can help identify if it's the cause.

  3. Network Issues: In some cases, network issues might cause SSL verification problems. Ensure you have a stable internet connection.

Remember that disabling SSL verification or not verifying the server's certificate can expose your communications to potential security risks. It's always best to resolve the underlying SSL issue rather than bypassing the verification.

energyLS commented 8 months ago

@hazemakhalek please retrigger CI and see if error persists @energyLS can review