GoogleCloudPlatform / data-science-on-gcp

Source code accompanying book: Data Science on the Google Cloud Platform, Valliappa Lakshmanan, O'Reilly 2017
Apache License 2.0
1.31k stars 715 forks source link

Chapter 2: curl: (60) SSL certificate problem: unable to get local issuer certificate #140

Closed BoHuang2018 closed 2 years ago

BoHuang2018 commented 2 years ago

Just tested the first command line in Chapter2 (the new version), to issue a HTTP POST downloading a single month data % curl -o temp.zip https://transtats.bts.gov/PREZIP/On_Time_Reporting_Carrier_On_Time_Performance_1987_present_2015_3.zip

Got error:

curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Tested with Cloud Shell and locally (osx), got the same error

However, the URL https://transtats.bts.gov/PREZIP/On_Time_Reporting_Carrier_On_Time_Performance_1987_present_2015_3.zip works on browser.

BoHuang2018 commented 2 years ago

Just solved this issue:

Using -k flag to avoid SSL error. The following terminal command works curl -k -o temp.zip https://transtats.bts.gov/PREZIP/On_Time_Reporting_Carrier_On_Time_Performance_1987_present_2015_3.zip

lakshmanok commented 2 years ago

code updated to Edition 2