Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]

I used a python package called python-certifi-win32 to fix this issue, but when I make an executable and run the file I am getting this error again. I also referred from another post and directly imported certifi-win32 package into my program and it worked except I am getting the same error in another part of my project. I am trying to implement Google sheets into my python project. Even though the authentication process works with no hiccups, the problem occurs when the app trying to make contact with google sheets / drive.

This is the fix I got from another post:

if sys.platform == 'win32':
    import certifi_win32
    os.environ['REQUESTS_CA_BUNDLE'] = certifi_win32.wincerts.where()
    certifi_win32.generate_pem()

This is the error I am getting right now after trying all the fixes:

Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1948, in __call__
  File "customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
    self._command()
  File "src\app\frontend\main_ui.py", line 51, in run_orm_google_sheets
    status = orm.run_google_sheets_save(drive_folder_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src\app\backend\oscilloscope_report_maker.py", line 219, in run_google_sheets_save
    spreadsheet_id = gs.create("Report")
                     ^^^^^^^^^^^^^^^^^^^
  File "src\app\backend\google_sheets_api_methods.py", line 41, in create
    .execute()
     ^^^^^^^^^
  File "googleapiclient\_helpers.py", line 130, in positional_wrapper
  File "googleapiclient\http.py", line 923, in execute
  File "googleapiclient\http.py", line 222, in _retry_request
  File "googleapiclient\http.py", line 191, in _retry_request
  File "google_auth_httplib2.py", line 218, in request
  File "httplib2\__init__.py", line 1724, in request
  File "httplib2\__init__.py", line 1444, in _request
  File "httplib2\__init__.py", line 1366, in _conn_request
  File "httplib2\__init__.py", line 1158, in connect
  File "ssl.py", line 517, in wrap_socket
  File "ssl.py", line 1075, in _create
  File "ssl.py", line 1346, in do_handshake
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1002

 

2 0 3,429
0 REPLIES 0
Top Labels in this Space
Top Solution Authors