'ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1131)

For the code

....

SCOPES = ['https://www.googleapis.com/auth/spreadsheets',]

# The ID and range of a sample spreadsheet.
SAMPLE_SPREADSHEET_ID = <My SpreadSheet>

creds = Credentials.from_authorized_user_file('token.json', SCOPES)
service = build('sheets', 'v4', credentials=creds)
sheet = service.spreadsheets()
result = sheet.values().get(spreadsheetId=SAMPLE_SPREADSHEET_ID,range="A:E").execute()
values = result.get()

It Gives

  File "C:\Users\Bamgm14\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1131)

I could not find an issue or Stackexchange answer so I am making the question I am not sure what happened. I tried everything possible from trying to make a new token (which gives the same problem) to resetting my Oauth Token to no change. Please give any help you can



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source