Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: 'OpenSSL.crypto' has no attribute 'sign' #2554

Open
Rodrigo-Novas opened this issue Jan 24, 2025 · 2 comments
Open

ERROR: 'OpenSSL.crypto' has no attribute 'sign' #2554

Rodrigo-Novas opened this issue Jan 24, 2025 · 2 comments
Assignees

Comments

@Rodrigo-Novas
Copy link

Environment details

  • OS type and version: ubuntu:20.04 and macOs 14.7.1
  • Python version: 3.11
  • pip version: I dont use pip y use Poetry 1.5.1
  • google-api-python-client version: 2.159.0

Steps to reproduce

  1. Install google-api-python-client with pip, pdm, poetry, hatch... it doesn't matter
  2. Use the method oauth to authenticate
    from oauth2client.service_account import ServiceAccountCredentials
  3. use .execute() method of any googleapi method
  4. this retrieves the error 'OpenSSL.crypto' has no attribute 'sign'

Why does this happen?

Because you are importing oauth2client on the line https://github.com/googleapis/google-api-python-client/blob/main/googleapiclient/_auth.py#L33 and it is deprecated, oauth2client uses openssl with the method sign and openssl removed the method sign on the version 24.3.0.

So if you install openssl >= 24.3.0, and if you use the oauth2client.service_account from googleapiclient this will retrieves you the error

ERROR: module 'OpenSSL.crypto' has no attribute 'sign'

How to solves this?

Set a constraint of openssl >= 24.3.0 on googleapiclient or dont import oauth2client on googleapi anymore.

@VincentLa
Copy link

Clarification question: do you mean set a constraint of openssl < 24.3.0 to avoid the error?

@Rodrigo-Novas
Copy link
Author

@VincentLa

I do think that having an openssl constraint while oauth2client is still there would be the right thing to do

kraj added a commit to YoeDistro/meta-openembedded that referenced this issue Feb 11, 2025
We have upgraded py3-openssl module to 24.3.0 in core, which
means this test now fails as py3-openssl has removed the APIs it uses [1]
disable until it is fixed in google-auth module

Fixes
ERROR: 'OpenSSL.crypto' has no attribute 'sign'

[1] googleapis/google-api-python-client#2554

Signed-off-by: Khem Raj <[email protected]>
kraj added a commit to YoeDistro/meta-openembedded that referenced this issue Feb 12, 2025
We have upgraded py3-openssl module to 24.3.0 in core, which
means this test now fails as py3-openssl has removed the APIs it uses [1]
disable until it is fixed in google-auth module

Fixes
ERROR: 'OpenSSL.crypto' has no attribute 'sign'

[1] googleapis/google-api-python-client#2554

Signed-off-by: Khem Raj <[email protected]>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Feb 13, 2025
…Key ptest

We have upgraded py3-openssl module to 24.3.0 in core, which
means this test now fails as py3-openssl has removed the APIs it uses [1]
disable until it is fixed in google-auth module

Fixes
ERROR: 'OpenSSL.crypto' has no attribute 'sign'

[1] googleapis/google-api-python-client#2554

Signed-off-by: Khem Raj <raj.khemgmail.com>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Apr 4, 2025
…Key ptest

We have upgraded py3-openssl module to 24.3.0 in core, which
means this test now fails as py3-openssl has removed the APIs it uses [1]
disable until it is fixed in google-auth module

Fixes
ERROR: 'OpenSSL.crypto' has no attribute 'sign'

[1] googleapis/google-api-python-client#2554

Signed-off-by: Khem Raj <raj.khemgmail.com>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Apr 9, 2025
…Key ptest

We have upgraded py3-openssl module to 24.3.0 in core, which
means this test now fails as py3-openssl has removed the APIs it uses [1]
disable until it is fixed in google-auth module

Fixes
ERROR: 'OpenSSL.crypto' has no attribute 'sign'

[1] googleapis/google-api-python-client#2554

Signed-off-by: Khem Raj <raj.khemgmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants