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

Bugfix: AttributeError exceptions when using codemagic.models.certificate #243

Merged
merged 8 commits into from
Jun 22, 2022

Conversation

priitlatt
Copy link
Contributor

@priitlatt priitlatt commented Jun 21, 2022

The internals of codemagic.models.Certificate rely heavily on X.509 certificate implementation OpenSSL.crypto.X509 from pyOpenSSL module.

Lately there have been number of conflicts (and consequently bugs in this repo) due to incompatibilities between pyOpenSSL and cryptography (such as #217). It is also strongly encouraged to replace pyOpenSSL usages with cryptography where possible (see the note on PyPI description).

Considering the above, codemagic.models.Certificate was refactored to use cryptography.x509.Certificate internally instead of OpenSSL.crypto.X509.

Changes were tested with the following pyOpenSSL and cryptography version combinations:

  • pyOpenSSL version 19.0.0 and cryptography versions 3.3.1, 35.0.0, 36.0.2, 37.0.1 and 37.0.2.
  • pyOpenSSL version 19.1.0 and cryptography versions 3.3.1, 35.0.0, 36.0.2, 37.0.1 and 37.0.2.
  • pyOpenSSL version 20.0.0 and cryptography versions3.3.1, 35.0.0, 36.0.2, 37.0.1 and 37.0.2.
  • pyOpenSSL version 20.0.1 and cryptography versions 3.3.1, 35.0.0, 36.0.2, 37.0.1 and 37.0.2.
  • pyOpenSSL version 21.0.0 and cryptography versions 3.3.1, 35.0.0, 36.0.2, 37.0.1 and 37.0.2.
  • pyOpenSSL version 22.0.0 and cryptography versions 3.3.1, 35.0.0, 36.0.2, 37.0.1 and 37.0.2.

Note that cryptography version 37.0.0 is still not supported and remains excluded from the allowed versions (also in setup.py).

@priitlatt priitlatt added bug Something isn't working dependencies Pull requests that update a dependency file labels Jun 21, 2022
@priitlatt priitlatt requested a review from VeArnold June 21, 2022 13:57
@priitlatt priitlatt marked this pull request as ready for review June 21, 2022 13:57
Copy link
Contributor

@VeArnold VeArnold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one minor comment, up to you, other than that LGTM

Co-authored-by: VeArnold <56921374+VeArnold@users.noreply.github.com>
@priitlatt priitlatt merged commit 6a129f2 into master Jun 22, 2022
@priitlatt priitlatt deleted the bugfix/certificate-model-dependence-on-pyopenssl branch June 22, 2022 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants