SSLError when I try to upload files into Box using Box API (JWT Auth)

23 views Asked by At

I get the following error when I try to upload files into Box using JWT Auth

requests.exceptions.SSLError: HTTPSConnectionPool(host='upload.box.com', port=443): Max retries exceeded with url: /api/2.0/files/content (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))

I tried the following code.

import json
from box_sdk_gen.client import BoxClient
from box_sdk_gen.jwt_auth import JWTConfig , BoxJWTAuth

from box_sdk_gen.managers.uploads import UploadFileAttributes,     UploadFileAttributesParentField, UploadsManager

 jwt_config = JWTConfig.from_config_file('xxxx/xxx_config.json')

 auth = BoxJWTAuth(config=jwt_config)
 user_auth = auth.as_user('3831914027')
 client = BoxClient(user_auth)

 attrs = UploadFileAttributes( name='xxx /xxx/xxx.csv',parent= UploadFileAttributesParentField(id='223389277713')


 Files = client.uploads.upload_file(attributes=attrs, file=open('xxx /xxx/xxx.csv', 'rb'))
0

There are 0 answers