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 Error when attempting to connect to the BOX API #725

Closed
mklem76 opened this issue Apr 14, 2022 · 3 comments
Closed

SSL Error when attempting to connect to the BOX API #725

mklem76 opened this issue Apr 14, 2022 · 3 comments
Labels

Comments

@mklem76
Copy link

mklem76 commented Apr 14, 2022

Hello - I am trying to create a python executable file that leverages the boxsdk login code. When I attempt to run the executable on my computer (python install) and my coworkers (Python not installed), I get the following error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='api.box.com', port=443): Max retries exceeded with url: /oauth2/token (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)')))

Even when I was leveraging the boxsdk in jupyter notebook i would get this error. I fixed it by changing my default browser from Google Chrome to Mozilla Firefox.

Do you have a way to get around this certificate issue with the BOXSDK?

@arjankowski
Copy link
Contributor

Hi @mklem76,

This is probably due to some proxy server in your company.
Your code not works from chrome and from executable file because chrome using system's network settings, where you probably have set some proxy settings. But It works on Firefox because it sandboxex the proxy connection and restricts it only to the specific browser window.

The approach we would recommend here is to get the certificate that's being injected by your proxy and set the REQUESTS_CA_BUNDLE environment variable to the path to that certificate (or a directory of CA certificates) when running your program.
The second approach which we do not recommend because it is insecure is to disable all SSL validation, you can set the PYTHONHTTPSVERIFY environment variable to 0.

If you are not sure about the proxy certificate please contact your administrator for help.

Hope this was helpful!

@stale
Copy link

stale bot commented Dec 19, 2022

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

@stale stale bot added the stale label Dec 19, 2022
@stale
Copy link

stale bot commented Dec 27, 2022

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.

@stale stale bot closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants