python-3.x - Python:SSL 证书失败
问题描述
这是我的代码:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope =['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)
client = gspread.authorize(creds)
sheet = client.open("Test)").sheet1
list_of_hashes = sheet.get_all_records()
print(list_of_hashes)
这是结果:
raise SSLError(e, request=request)
requests.exceptions.SSLError:
HTTPSConnectionPool(host='sheets.googleapis.com', port=443):
Max retries exceeded with url: /v4/spreadsheets/1AXzSsuOZfZpHDv4jgYCgNbpooxhhYpx8HG6Ue3zq88M?includeGridData=false
(Caused by SSLError(SSLError("bad handshake: Error([('SSL routines',
'ssl3_get_server_certificate',
'certificate verify failed')],)",),))
解决方案
推荐阅读
- java - 如何将 .cpp C++ 本机库导入 Android Studio
- android - 如何在 Android 中自定义 ContextMenu?
- c# - 根据对象属性查找和添加对象
- javascript - JQuery Ajax to Fetch Conversion clarificartions
- vue.js - 当 CSS 有作用域时,在两个不同的组件中使用相同的类名是一种不好的做法吗?
- mysql - 为什么 TIMESTAMP 返回 NULL
- javascript - 如何在 LoopBack 3 中使用 where 过滤相关模型(hasMany 关系)
- php - 如何使用自定义 JMS 序列化程序处理程序设置 Nelmio Doc
- pandas - 熊猫将每隔一秒重复的行值设置为零
- excel - 如何将单元格坐标存储到变量中?