Skip to content

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

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

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

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

Rodrigo-Novas opened this issue Jan 24, 2025 · 3 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

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>
@vchudnov-g
Copy link
Contributor

Thanks for reporting this issue! We will investigate.

@vchudnov-g vchudnov-g removed their assignment Apr 24, 2025
@vchudnov-g vchudnov-g added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants