Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL certificate verify failed #17

Open
girmax opened this issue Dec 16, 2019 · 5 comments
Open

SSL certificate verify failed #17

girmax opened this issue Dec 16, 2019 · 5 comments
Assignees

Comments

@girmax
Copy link

girmax commented Dec 16, 2019

running the following on Python 3.7 Virtual env , Win 10

from stats_can import StatsCan
sc = StatsCan()
df = sc.table_to_df("271-000-22-01")

error code:
SSLError: HTTPSConnectionPool(host='www150.statcan.gc.ca', port=443): Max retries exceeded with url: /t1/wds/rest/getCubeMetadata (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

@ianepreston ianepreston self-assigned this Dec 17, 2019
@ianepreston
Copy link
Owner

Hi @girmax. I just ran the same setup on my machine and it seems to be ok. That's going to make it difficult to troubleshoot.

Given that it's an SSL error I think the first thing to check would be if you can get a response from your browser. That api is a little tricky to call from the browser, but see what you get with this:
https://www150.statcan.gc.ca/t1/wds/rest/getChangedCubeList/2017-12-07
If that loads some json in your browser then try the equivalent stats_can functionality:

import stats_can
stats_can.get_changed_cube_list()

and see if it retrieves something similar looking.

Hope that helps, please report back what you find.

@girmax
Copy link
Author

girmax commented Dec 17, 2019

hi @ianepreston .
It gives me json output below when i try https://www150.statcan.gc.ca/t1/wds/rest/getChangedCubeList/2017-12-07 in the browser.
{"status":"SUCCESS","object":[{"responseStatusCode":0,"productId":32100077,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100001,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100002,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100003,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100004,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100005,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100006,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100007,"releaseTime":"2017-12-07T08:30"},{"responseStatusCode":0,"productId":34100008,"releaseTime":"2017-12-07T08:30"},

When i run fron anaconda env the following
import stats_can
stats_can.get_changed_cube_list()

i get SSLError: HTTPSConnectionPool(host='www150.statcan.gc.ca', port=443): Max retries exceeded with url: /t1/wds/rest/getChangedCubeList/2019-12-17 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

@ianepreston
Copy link
Owner

Hi @girmax,
I'll try and reproduce on my end. Can you send me your conda environment?
Either this or this would be fine.

@manolo20
Copy link

Hi @girmax, was this an issue in a Linux OS? I had a similar issue and it was solved by modifying the OpenSSL.cnf.

@zehengl
Copy link
Contributor

zehengl commented Jul 29, 2020

@girmax Are you in a corporate network? If so, sounds like a CA certs issue to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants