You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using authentication method 1 to upload data to a SharePoint List with client id and client secret. This works fine, but when I package the code as .exe with pyinstaller, then i get an SSL certificate failure. I have tried to disable SSL certificate validation, explicitly load cacert.pem in local folder and adding this as parameter in pyinstaller and adding office365 to the spec file, but to no avail. My code snip:
with open('config.json', 'r') as file:
config = json.load(file)
client_id = config['client_id']
client_secret = config['client_secret']
site_url = config['site_url']
def add_non_empty(item_properties, key, value):
if pd.notna(value) and value != '':
item_properties[key] = value
ctx = ClientContext(site_url).with_client_credentials(client_id, client_secret)
metadata = pd.read_excel('3_processed_output/metadata.xlsx')
list_title = '08_assessments'
list_obj = ctx.web.lists.get_by_title(list_title)
for index, row in metadata.iterrows():
item_properties = {}
add_non_empty(item_properties, 'Localtaxauthority', 'AMSTERDAMMMM')
new_item = list_obj.add_item(item_properties)
ctx.execute_query()
The error once ran as .exe:
Traceback (most recent call last):
File "urllib3\connectionpool.py", line 464, in _make_request
File "urllib3\connectionpool.py", line 1093, in _validate_conn
File "urllib3\connection.py", line 741, in connect
File "urllib3\connection.py", line 920, in _ssl_wrap_socket_and_match_hostname
File "urllib3\util\ssl_.py", line 460, in ssl_wrap_socket
File "urllib3\util\ssl_.py", line 504, in _ssl_wrap_socket_impl
File "ssl.py", line 455, in wrap_socket
File "ssl.py", line 1041, in _create
File "ssl.py", line 1319, in do_handshake
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)
All tips would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
I'm using authentication method 1 to upload data to a SharePoint List with client id and client secret. This works fine, but when I package the code as .exe with pyinstaller, then i get an SSL certificate failure. I have tried to disable SSL certificate validation, explicitly load cacert.pem in local folder and adding this as parameter in pyinstaller and adding office365 to the spec file, but to no avail. My code snip:
The error once ran as .exe:
All tips would be greatly appreciated.
The text was updated successfully, but these errors were encountered: