gpt4 book ai didi

python - Google Admin SDK 客户端库生成 SSL3_GET_RECRD :wrong version number error when attempting to get a user

转载 作者:太空宇宙 更新时间:2023-11-03 14:12:40 25 4
gpt4 key购买 nike

我正在尝试使用 Google Admin SDK API 和 python 客户端库来管理我的 Google Apps 用户。我正在尝试获取某个用户,bssl.SSLError: [Errno 1] _ssl.c:1429:

error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

我的代码(大部分)如下:

import httplib2
from apiclient import errors
from apiclient.discovery import build

client_email = 'service_account_email@developer.gserviceaccount.com'
with open("service_account_certificate.p12") as f:
private_key = f.read()
OAUTH_SCOPE = 'https://www.googleapis.com/auth/admin.directory.user'
credentials = SignedJwtAssertionCredentials(client_email, private_key, OAUTH_SCOPE, sub="admin@domain.com" )
http = httplib2.Http()
http = credentials.authorize(http)

directory_service = build('admin', 'directory_v1', http=http)

user = directory_service.users().get(userKey="someuser@domain.com").execute()

最后一行似乎是导致问题的原因。有什么提示吗?

E.

最佳答案

SSL routines:SSL3_GET_RECORD:wrong version number

服务器不再支持 SSLv3。您需要升级您的 pip 模块和/或 Python。

关于python - Google Admin SDK 客户端库生成 SSL3_GET_RECRD :wrong version number error when attempting to get a user,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27233424/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com