Skip to content

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

Open

Description

@Rodrigo-Novas

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.

Activity

  1. VincentLa commented on Jan 30, 2025

    @VincentLa

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

  2. Rodrigo-Novas commented on Jan 31, 2025

    @Rodrigo-Novas
    Author

    @VincentLa

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

  3. vchudnov-g commented on Apr 24, 2025

    @vchudnov-g
    Contributor

    Thanks for reporting this issue! We will investigate.

  4. removed their assignment
    on Apr 24, 2025
  5. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 24, 2025
  6. h0nIg commented on Jun 3, 2025

    @h0nIg

    @vchudnov-g @VincentLa you should not set a constraint to use an older pyopenssl version, please stop using oauth2client - which is deprecated since 2018 and the repo is archived! https://github.com/googleapis/oauth2client

  7. daniel-sanche commented on Feb 26, 2026

    @daniel-sanche
    Contributor

    oauth2client is unsupported, so I think this can be closed

  8. wookayin commented on Feb 26, 2026

    @wookayin

    I see this error happening with particular versions of gsutil and PyopenSSL; not necessarily a sole problem of oauthclient.

  9. daniel-sanche commented on Feb 27, 2026

    @daniel-sanche
    Contributor

    Can you post a reproductive sample? The original bug report was focused on using oauth2client, but if you can share another way to reproduce the error, I can take a look

  10. added
    priority: p3Desirable enhancement or fix. May not be included in next release.
    and removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions