ctype'EVP_MD_CTX *'的初始化程序必须是指向同一类型的指针,而不是cdata'EVP_MD_CTX *'

时间:2014-11-11 09:08:45

标签: python google-api-python-client pyopenssl oauth2client

一段时间以来,我一直在使用oauth2client(使用p12或pem的服务帐户),这个令人讨厌的“ctype初始化程序'EVP_MD_CTX *'必须是指向相同类型的指针,而不是cdata'EVP_MD_CTX *'”错误证书文件)。

在WSGI下运行django项目时会发生这种情况。我从未在外壳上发生这种情况。

package versions:
google-api-python-client==1.3.1
pyOpenSSL==0.14
oauth2client==1.3.2
cryptography==0.6.1

Revelant stacktrace(直到那时我创建了SignedJwtAssertionCredentials并在http对象上完成了authorize()):

File "gdrive/models.py", line 292, in create_service
  return build("drive", "v2", http=http)
File "oauth2client/util.py", line 129, in positional_wrapper
  return wrapped(*args, **kwargs)
File "googleapiclient/discovery.py", line 198, in build
  resp, content = http.request(requested_url)
File "oauth2client/util.py", line 129, in positional_wrapper
  return wrapped(*args, **kwargs)
File "oauth2client/client.py", line 516, in new_request
  self._refresh(request_orig)
File "oauth2client/client.py", line 728, in _refresh
  self._do_refresh_request(http_request)
File "oauth2client/client.py", line 752, in _do_refresh_request
  body = self._generate_refresh_request_body()
File "oauth2client/client.py", line 1275, in _generate_refresh_request_body
  assertion = self._generate_assertion()
File "oauth2client/client.py", line 1402, in _generate_assertion
  private_key, self.private_key_password), payload)
File "oauth2client/crypt.py", line 312, in make_signed_jwt
  signature = signer.sign(signing_input)
File "oauth2client/crypt.py", line 109, in sign
  return crypto.sign(self._key, message, 'sha256')
File "OpenSSL/crypto.py", line 2091, in sign
  _lib.EVP_SignInit(md_ctx, digest_obj)

并且会引发异常。

有关此错误出现原因的任何想法?

谢谢, 渣

0 个答案:

没有答案