2013-08-26 2 views
2

저는 우분투 서버에서 google api 클라이언트 라이브러리를 사용하고 있습니다. 스크립트가 내 컴퓨터에서 제대로 작동하지만 서버에서는 SSLError와 함께 실패합니다.google api 클라이언트 라이브러리를 사용할 때 SSLError

File "/home/default/bigbluebutton/youtube/uploader/uploadvideo.py", line 78, in authorize 
    credentials = flow.step2_exchange(code)   
    File "/usr/local/lib/python2.7/dist-packages/oauth2client/util.py", line 132, in positional_wrapper 
    return wrapped(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 1283, in step2_exchange 
    headers=headers) 
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1570, in request 
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) 
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1317, in _request 
    (response, content) = self._conn_request(conn, request_uri, method, body, headers) 
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1252, in _conn_request 
    conn.connect() 
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1021, in connect 
    self.disable_ssl_certificate_validation, self.ca_certs) 
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 80, in _ssl_wrap_socket 
    cert_reqs=cert_reqs, ca_certs=ca_certs) 
    File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket 
    ciphers=ciphers) 
    File "/usr/lib/python2.7/ssl.py", line 141, in __init__ 
    ciphers) 
ssl.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib 

이 문제를 해결하는 방법은 무엇입니까? SSL에 문제가 있습니까?

+1

여기 정보가 도움이 될 수 있습니다. https://github.com/kennethreitz/requests/issues/557 –

+0

시도했지만 도움이되지 않습니다. 서버는 우분투 12.04이며 m 개발 기계와 동일합니다. –

+0

해당 링크의 어떤 솔루션을 시도하셨습니까? –

답변

1

나를 위해 적합한 해결책은 cacerts.txt의 권한을 루트가 아닌 사용자에게 변경하는 것입니다. 또는 루트로 실행하십시오. 이 파일은 /usr/local/lib/python2.7/dist-packages/httplib2/cacerts.txt에서 찾을 수 있습니다.

0

동일한 문제가 발생했습니다. 해당 인증서를로드 할 수 없었기 때문입니다. 다음은 인증서를로드하는 httplib2/ .py의 코드입니다.

try: 
     # Users can optionally provide a module that tells us where the CA_CERTS 
     # are located. 
     import ca_certs_locater 
     CA_CERTS = ca_certs_locater.get() 
    except ImportError: 
     # Default CA certificates file bundled with httplib2. 
     CA_CERTS = os.path.join(
      os.path.dirname(os.path.abspath(__file__)), "cacerts.txt") 

httplib2/ 평 위치 초기화 : /usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/ 초기화

위 코드에서 ca_certs_locater는 httplib2 패키지의 인증 기관 파일 대신 기본 인증 기관의 인증 기관 파일을로드합니다. ca_certs_locater 모듈이 없으면 cacerts.txt 파일에서 인증서를로드합니다.

필자의 경우 모듈이 없기 때문에 "cacerts.txt"파일에서로드되었으므로 현재인지 여부는 확실하지 않습니다. ca_certs_locater 모듈을 설치하여이 문제를 해결했습니다.

관련 문제