Quantcast
Channel: How to display the Subject Alternative Name of a certificate? - Stack Overflow
Browsing all 14 articles
Browse latest View live

Answer by Faisal for How to display the Subject Alternative Name of a...

Use the openssl's -ext option, refer here for openssl x509 command options and here for available -extensions flags you can use.Sample output:$ openssl x509 -noout -ext subjectAltName -in...

View Article



Answer by NerdyDeeds for How to display the Subject Alternative Name of a...

Parsed into an arrayJust one more option if anyone prefers. This will capture any number of Alt Names, "push"ing each into a Bash array. Below the parsing code, I'll explain how to retrieve any single...

View Article

Answer by shadyabhi for How to display the Subject Alternative Name of a...

Here's how we can do this via awk. '/Subject: C=/{printf $NF"\n"} matches any line which has pattern /Subject: C= and {printf $NF"\n"} simply prints the last field with a newline. /DNS:/{x=gsub(/...

View Article

Answer by Ely for How to display the Subject Alternative Name of a certificate?

Newer versions of openssl have an '-ext' option that allows you to print only the subjectAltName record. Am using 'OpenSSL 1.1.1b' on Debian 9.9openssl x509 -noout -ext subjectAltName -in...

View Article

Answer by NOZUONOHIGH for How to display the Subject Alternative Name of a...

Maybe this is enough:openssl x509 -in cert.pem -noout -text -certopt ca_default,no_sigdump

View Article


Answer by sastorsl for How to display the Subject Alternative Name of a...

Adding a python alternative.Prerequisite is that you have a string with the "DNS:" records.Fetch the certificate details (subprocess, OpenSSL module, etc) dnsstring contains the "DNS:" line of the...

View Article

Answer by Otheus for How to display the Subject Alternative Name of a...

An improved awk-based solution (hat-tip: @RandomW): openssl x509 -in certfile -text -noout \ -certopt no_header,no_version,no_serial,no_signame,no_validity,no_issuer,no_pubkey,no_sigdump,no_aux \| awk...

View Article

Answer by ThinGuy for How to display the Subject Alternative Name of a...

Very simple solution using grepopenssl x509 -in /path/to/x509/cert -noout -text|grep -oP '(?<=DNS:|IP Address:)[^,]+'|sort -uVFor the google certificate, this...

View Article


Answer by F. Hauri - Give Up GitHub for How to display the Subject...

There is my solution (using openssl and sed):bash firstsed -ne ' s/^\( *\)[Ss]ubject[:=] */ \1/p; /X509v3 Subject Alternative Name/{ N; s/^.*\n//; :a; s/^\( *\)\(.*\), /\1\2\n\1/; ta; p; q; }'<...

View Article


Answer by jww for How to display the Subject Alternative Name of a certificate?

How to display the Subject Alternative Name of a certificate?There could be multiple SANs in a X509 certificate. The following is from the OpenSSL wiki at SSL/TLS Client. It loops over the names and...

View Article

Answer by ThorSummoner for How to display the Subject Alternative Name of a...

Fetch Certificate DataWith gnutls and certtool$ gnutls-cli example.com -p 443 --print-cert < /dev/null | certtool -i | grep -C3 -i dnsWith opensslTaken from...

View Article

Answer by RandomW for How to display the Subject Alternative Name of a...

You can use awk to get closer to the SAN, piping the above options into the awk statement:openssl x509 -in mycertfile.crt -text -noout \ -certopt...

View Article

Answer by Raman for How to display the Subject Alternative Name of a...

Note that you can limit the output of -text to just the extensions by adding the following option:-certopt...

View Article


How to display the Subject Alternative Name of a certificate?

The closest answer that I found is using "grep".> openssl x509 -text -noout -in cert.pem | grep DNSIs there better way to do this? I only prefer command line.Thanks.

View Article
Browsing all 14 articles
Browse latest View live




Latest Images