Certificate Verify Failed

Highlighted
First-time Contributor

Certificate Verify Failed

Hello,

 

I was trying to use the developer token to access BOX via Python (v 3.6):

 

from boxsdk import DevelopmentClient
client = DevelopmentClient()

Enter developer token: ...

user = client.user().get()

 

I get the following error:

 

requests.exceptions.SSLError: HTTPSConnectionPool(host='api.box.com', port=443): Max retries exceeded with url: /2.0/users/me (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),))

 

I tried to copy and paste the BOX cert into ...\Python-3.6.1\Lib\site-packages\certifi\cacert.pem but no luck. 

 

Any help would be appreciated!

Tags (2)
2 REPLIES 2
Highlighted
Box Employee

Re: Certificate Verify Failed

Hey @Bobolat

 

Wanted to follow up here and ask if you are running through a proxy of any kind?

 

There could be a variety of things at play here so we'll try and narrow down the issue. I see you've placed your cert inside your trust store.

Highlighted
First-time Contributor

Re: Certificate Verify Failed

Hello ,

 

@carycheng77  i have the same issue ,i'm just trying to run a simple sample code which is as follow :

 

from boxsdk import OAuth2, Client
import requests

auth = OAuth2(
client_id='***********',
client_secret='**************',
access_token='*********',
)
client = Client(auth)

user = client.user().get()
print('The current user ID is {0}'.format(user.id))

 

However i get this error message : 

requests.exceptions.SSLError: HTTPSConnectionPool(host='api.box.com', port=443): Max retries exceeded with url: /2.0/users/me (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

 

Could you please provide any kind of assistance on that matter ?

 

Thanks,

 

Karim Baba