microsoft / BatteryML

MIT License
516 stars 109 forks source link

CALCE raw data download problem #30

Closed JingyiJia closed 6 months ago

JingyiJia commented 7 months ago

Hi ,

I've encountered an SSL certificate verification error while trying to use the BatteryML tool to download the CALCE dataset. It appears the certificate for the CALCE website has expired. Has anyone else faced this issue, and could there be a recommended approach to safely download the dataset?

image

image

Thanks for your help!

agiamason commented 7 months ago

Hi Jingyi, I'm so sorry you're having this problem. Perhaps you can try to upgrade requests, or refer to the following gpt4 generated solutions, if you have other problems also welcome to contact us! gpt4 solutions for your reference: The SSLError usually occurs due to a failed verification of the SSL certificate of the server you're connecting to. Here are a few ways to handle this:

  1. You can bypass SSL verification by setting the verify parameter to False. However, this is not recommended for production code as it makes your request vulnerable to man-in-the-middle attacks.
response = requests.get(url, stream=True, verify=False)  
  1. If the SSL certificate is self-signed, you can download the certificate and point to it in your request. This is a safer way to handle self-signed certificates.
response = requests.get(url, stream=True, verify='/path/to/certfile')  
  1. If you're facing this issue due to an outdated requests library, updating it might solve the problem. You can update it using pip:
pip install --upgrade requests  
  1. It could also be due to outdated or missing root certificates on your machine. On macOS, running the following command updates the root certificates:
/Applications/Python\ 3.x/Install\ Certificates.command  

Replace 3.x with your Python version.

Please use these suggestions with caution and ensure you understand the security implications before bypassing SSL verification.