Closed MarcoPolo closed 1 year ago
Since we want to use version 3, we actually need to pass 2 here. I know it's confusing. Without this you will fail to interop with go-libp2p nodes since they have no idea how to parse an unknown version of x509.
Sources:
Note: the values of these constants are defined by standards (X.509 et al) to be one less than the certificate version. So X509_VERSION_3 has value 2 and X509_VERSION_1 has value 0. https://www.openssl.org/docs/man3.0/man3/X509_set_version.html
Note it might be better to use the defined constant X509_VERSION_3, but I haven't compiled the project so I knew s/3/2 was a safe change.
X509_VERSION_3
Since we want to use version 3, we actually need to pass 2 here. I know it's confusing. Without this you will fail to interop with go-libp2p nodes since they have no idea how to parse an unknown version of x509.
Sources:
Note it might be better to use the defined constant
X509_VERSION_3
, but I haven't compiled the project so I knew s/3/2 was a safe change.