Contents
How to specify subjectAltName in the OpenSSL CLI?
Try to write the subjectAltName to a temporary file (I’ll name it hostextfile) like and link to it in openssl command via “-extfile” option, for example: The openssl command doesn’t provide a way to include extensions like the subjectAltName without writing a config file first.
How to insert a San into OpenSSL certificate?
The v3_req is required with the entry subjectAltName in the config file. The command will insert the SAN into the certificate.
How to generate a self signed certificate with OpenSSL?
Closed 6 years ago. I am trying to generate a self-signed certificate with OpenSSL with SubjectAltName in it.While I am generating the csr for the certificate, my guess is I have to use v3 extensions of OpenSSL x509. I am using :
How to create a certificate with Subject Alternative?
My hunch is that the subject Alternative Name is not showing up b/c it is not present in the V1 specs, which is why I’m also pursuing setting he version. While generating the CSR you should use -config and -extensions and while generating certificate you should use -extfile and -extensions
How to use sans with OpenSSL instead of common name?
“x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0”.
How to generate a self signed certificate in OpenSSL?
Note: the -extensions san_env parameter needs to be present when signing the CSR as well as when generating it. Therefore, for CA-signed CSRs add -extensions san_env to the openssl ca command as well. This is my solution to finally generate a working self signed cert, based on the answers above (The accepted answer don’t work for me):
How to use a one liner in OpenSSL?
The one liner is nice so I incorporated it into a routine that allows the subject alternative names as command arguments rather than values in a file also the flexibility to SAN or not to SAN. Try it with one argument then with many.