2

I am trying to use the python pvlib library to get weather forecast data and it worked at the beginning, but now I keep getting this SSL Certificate Error. Could you help me with resolving this issue?

Code below:

from pvlib.forecast import GFS, HRRR_ESRL, NAM, NDFD, HRRR, RAP

fm = GFS()
data = fm.get_data(latitude, longitude, start, end)

Error message:

SSLError: HTTPSConnectionPool(host='thredds.ucar.edu', port=443): Max retries exceeded with url: /thredds/catalog.xml (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

tdy
  • 36,675
  • 19
  • 86
  • 83
bchoi
  • 41
  • 5
  • Hi @bchoi are you on a mac? – Cassiopea Sep 24 '21 at 16:39
  • One possibility: If you're connected to a VPN, try disabling it and rerunning the data fetch function. There are several websites/APIs that fail with SSL errors when I'm connected to my employer's VPN but work fine as soon as I disconnect. – kevinsa5 Sep 24 '21 at 18:00
  • @MariaZentsova I'm on PC. Actually, it works again now that I'm connected to my company's wifi in the office. Thank you for the quick response! – bchoi Sep 24 '21 at 19:22
  • @kevinsa5 I think that is why. The code runs fine again with my company's wifi. Thank you for the quick response! – bchoi Sep 24 '21 at 19:26
  • @bchoi feel free to post that as an answer to your own question! Including details may help future readers. https://stackoverflow.com/help/self-answer – kevinsa5 Sep 24 '21 at 20:02

1 Answers1

1

I was using my company laptop, and it looks like the error was associated with the VPN connection issue. The code runs fine when I'm at the office using the office wifi, but it does not work at home.

bchoi
  • 41
  • 5