0

나는 서비스 계정을 사용하여 Google 웹 로그 분석에 연결하기 위해 노력하고있어 용 Google API 클라이언트 라이브러리를 사용하여 Google 웹 로그 분석에 연결할 때, 그러나 나는 다음과 같은 오류 얻을 :SSLHandshakeError 파이썬

SSLHandshakeError at ... 
[Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 

내가 PyOpenSSL 및 PyCrypto가 설치를 업데이트되었습니다.

from oauth2client.client import SignedJwtAssertionCredentials 
from apiclient.discovery import build 
import httplib2 

def initialize_service(): 
    f = open('path_to_key_file.p12', 'rb') 

    key = f.read() 
    f.close()  
    credentials = SignedJwtAssertionCredentials('[email protected]', key, scope='https://www.googleapis.com/auth/analytics.readonly') 
    http = httplib2.Http() 
    http = credentials.authorize(http) 
    print 'This is printed' 
    service = build('analytics', 'v3', http=http) 
    print 'This is not printed' 

    return service 

답변

0

시스템 클럭이 현재 시간으로 설정되지 않았기 때문에 문제가 발생한 것 같습니다 :

는 여기에 연결하는 데 사용하는 코드입니다.