-
Notifications
You must be signed in to change notification settings - Fork 52
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
If the common name is empty for the certificate, pygnmi fails due to this line.
>>> ssl_cert_deserialized
<Certificate(subject=<Name(<<redacted>>)>, ...)>
>>> ssl_cert_deserialized.subject.get_attributes_for_oid(x509.oid.NameOID.COMMON_NAME)
[]
I bypassed this using an if-else block, manually setting ssl_target_name_override. But this time pygnmi failed due to alternative name.
>>> ssl_cert_subject_alt_names = ssl_cert_deserialized.extensions.get_extension_for_oid(x509.oid.ExtensionOID.SUBJECT_ALTERNATIVE_NAME)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/redacted/redacted/.virtualenvs/redacted/lib/python3.8/site-packages/cryptography/x509/extensions.py", line 125, in get_extension_for_oid
raise ExtensionNotFound("No {} extension was found".format(oid), oid)
cryptography.x509.extensions.ExtensionNotFound: No <ObjectIdentifier(oid=2.5.29.17, name=subjectAltName)> extension was found
I tried this with a second certificate we use on some other devices and it failed with the same error.
I'm not sure what is missing here but I am using the same certificates with other gnmi tools in production so I don't think there's something wrong with them.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working