我正在尝试使用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()
最后一行似乎是导致问题的那一行。任何提示?
电子。
答案 0 :(得分:1)
SSL例程:SSL3_GET_RECORD:版本号错误
服务器不再支持SSLv3。您需要升级您的pip模块和/或Python。