For some time now I have been getting this nasty "initializer for ctype 'EVP_MD_CTX *' must be a pointer to same type, not cdata 'EVP_MD_CTX *'" error when using oauth2client (with a service account using a p12 or pem certificate file).
This happens when running a django project under WSGI. I never got it to happen on the shell.
package versions:
google-api-python-client==1.3.1
pyOpenSSL==0.14
oauth2client==1.3.2
cryptography==0.6.1
Revelant stacktrace (until that point I have created the SignedJwtAssertionCredentials and done the authorize() on the http object):
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)
And there the exception gets raised.
Any ideas on why this error is appearing?
Thanks, marc