OpenSSL CSR parse command display Version Unknown #23968
-
While parsing CSR using openssl command line noticed version field shows as Unknown.
Openssl version used
The same CSR shows correct version with old version of OpenSSL 1.1.1k CSR version set to 1 using X509_REQ_set_version(x509Req.get(), nVersion); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
why version field of CSR is shown as Unknown with latest openssl ? |
Beta Was this translation helpful? Give feedback.
-
This code snippet is not sufficient to see what you did because you did not provide the value of 1 is not the correct version number for a CSR. CSR versions are defined as:
https://www.rfc-editor.org/rfc/rfc2986.html#section-4 This means a version |
Beta Was this translation helpful? Give feedback.
This code snippet is not sufficient to see what you did because you did not provide the value of
nVersion
. That said, I can guess as to what went wrong. Your code is incorrect. In fact, a compliant CSR parser would refuse to parse your structure altogether, not just print "Unknown".1 is not the correct version number for a CSR. CSR versions are defined as:
https://www.rfc-editor.org/rfc/rfc2986.html#section-4
This means a version
v1
CSR actually has value zero. You should be using the constantX509_REQ_VERSION_1
, not 1. Better yet, just don't callX509_REQ_set_version
at…