ssl.sslcertverificationerror:[ssl:centergy_verify_failed]证书验证失败:自签名证书(_SSL.C:1131)

发布于 2025-01-20 13:44:57 字数 872 浏览 4 评论 0原文

代码,

....

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()

对于它给出的

  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)

我找不到问题或 Stackexchange 答案,所以我提出了问题 我不确定发生了什么事。我尝试了一切可能的方法,从尝试创建一个新令牌(这会产生同样的问题)到将我的 Oauth 令牌重置为无变化。请提供您力所能及的帮助

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文