-
Notifications
You must be signed in to change notification settings - Fork 39
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
dependency cryptography now raises Exceptions on initial parse, breaking on TLS test on malformed certs #662
Comments
cert
openssl output
stack trace
|
Looking further into this, because it blocks my own progress:
And indeed, this seems to be the case, quoting the cryptography changelog for version v35.0.0, released september last year:
|
@stitch did you run into this same issue in v1.4.3? |
diff --git a/checks/tasks/tls.py b/checks/tasks/tls.py
index 158d07c..eb0a9af 100644
--- a/checks/tasks/tls.py
+++ b/checks/tasks/tls.py
@@ -13,7 +13,7 @@ from timeit import default_timer as timer
from celery import shared_task
from celery.exceptions import SoftTimeLimitExceeded
from cryptography.x509 import load_pem_x509_certificate, NameOID, ExtensionOID
-from cryptography.x509 import ExtensionNotFound, SignatureAlgorithmOID, DNSName
+from cryptography.x509 import ExtensionNotFound, InvalidVersion, SignatureAlgorithmOID, DNSName
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.backends.openssl.ec import _EllipticCurvePublicKey
from cryptography.hazmat.backends.openssl.dh import _DHPublicKey
@@ -1599,7 +1599,7 @@ def cert_checks(
debug_chain = starttls_details.debug_chain
conn_port = starttls_details.conn_port
except (socket.error, http.client.BadStatusLine, NoIpError,
- ConnectionHandshakeException, ConnectionSocketException):
+ ConnectionHandshakeException, ConnectionSocketException, InvalidVersion):
return dict(tls_cert=False)
if debug_chain is None: is what I'm using now as a workaround. It's not great, because it effectively nukes all cert tests and returns "Test error. Please try again later.", which is definitely not going to help any real user. Either we pin cryptography to an old version (yuk), or fix this properly, which perhaps involves adding an extra |
While I agree, I think before we invest time in this, we should work out a way forward for #714, as that may affect whether this code will stay. This scenario seems rare enough that we can afford to leave it as is for a while longer. |
Just caught this unhandled exception in my logs. Not sure about impact,
probably minor.domain that triggered this is
mookenmiddelaar.nl
. It passes all the TLS tests except for DANE. I ran across this while investigating errors during a batch test run of #30.The text was updated successfully, but these errors were encountered: