Bugfix: AttributeError
exceptions when using codemagic.models.certificate
#243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The internals of
codemagic.models.Certificate
rely heavily on X.509 certificate implementationOpenSSL.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 usecryptography.x509.Certificate
internally instead ofOpenSSL.crypto.X509
.Changes were tested with the following pyOpenSSL and cryptography version combinations:
19.0.0
and cryptography versions3.3.1
,35.0.0
,36.0.2
,37.0.1
and37.0.2
.19.1.0
and cryptography versions3.3.1
,35.0.0
,36.0.2
,37.0.1
and37.0.2
.20.0.0
and cryptography versions3.3.1
,35.0.0
,36.0.2
,37.0.1
and37.0.2
.20.0.1
and cryptography versions3.3.1
,35.0.0
,36.0.2
,37.0.1
and37.0.2
.21.0.0
and cryptography versions3.3.1
,35.0.0
,36.0.2
,37.0.1
and37.0.2
.22.0.0
and cryptography versions3.3.1
,35.0.0
,36.0.2
,37.0.1
and37.0.2
.Note that cryptography version 37.0.0 is still not supported and remains excluded from the allowed versions (also in
setup.py
).