diff --git a/scripts/ssl-cert.nse b/scripts/ssl-cert.nse
index 0e4ab77b3..03f5ff2d5 100644
--- a/scripts/ssl-cert.nse
+++ b/scripts/ssl-cert.nse
@@ -11,34 +11,44 @@ local unicode = require "unicode"
local have_openssl, openssl = pcall(require, "openssl")
description = [[
-Retrieves a server's SSL certificate. The amount of information printed
-about the certificate depends on the verbosity level. With no extra
-verbosity, the script prints the validity period and the commonName,
-organizationName, stateOrProvinceName, and countryName of the subject.
+Retrieves a server's SSL certificate. The amount of information printed about
+the certificate depends on the verbosity level. With no extra verbosity, the
+script prints the validity period and the commonName, organizationName,
+stateOrProvinceName, and countryName of the subject. When present, it also
+outputs all the subject alternative names.
443/tcp open https
-| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
+| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.
/stateOrProvinceName=California/countryName=US
-| Not valid before: 2011-03-23 00:00:00
-|_Not valid after: 2013-04-01 23:59:59
+| Subject Alternative Name: DNS:www.paypal.com, DNS:fastlane.paypal.com,
+DNS:secure.paypal.com, DNS:www-st.paypal.com, DNS:connect.paypal.com,
+...
+DNS:es.paypal-qrc.com, DNS:www.fastlane.paypal.com
+| Not valid before: 2024-02-08T00:00:00
+|_Not valid after: 2025-02-08T23:59:59
With -v it adds the issuer name and fingerprints.
443/tcp open https
-| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
+| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.
/stateOrProvinceName=California/countryName=US
-| Issuer: commonName=VeriSign Class 3 Extended Validation SSL CA\
-/organizationName=VeriSign, Inc./countryName=US
+| Subject Alternative Name: DNS:www.paypal.com, DNS:fastlane.paypal.com,
+DNS:secure.paypal.com, DNS:www-st.paypal.com, DNS:connect.paypal.com,
+...
+DNS:es.paypal-qrc.com, DNS:www.fastlane.paypal.com
+| Issuer: commonName=DigiCert SHA2 Extended Validation Server CA
+/organizationName=DigiCert Inc/countryName=US/organizationalUnitName=www.digicert.com
| Public Key type: rsa
| Public Key bits: 2048
-| Signature Algorithm: sha1WithRSAEncryption
-| Not valid before: 2011-03-23 00:00:00
-| Not valid after: 2013-04-01 23:59:59
-| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
-|_SHA-1: d846 5221 467a 0d15 3df0 9f2e af6d 4390 0213 9a68
+| Signature Algorithm: sha256WithRSAEncryption
+| Not valid before: 2024-02-08T00:00:00
+| Not valid after: 2025-02-08T23:59:59
+| MD5: 7cc7 a345 a164 dfb1 4690 0277 a540 f636
+| SHA-1: 9269 a100 8f61 aa60 1706 fc85 fd47 d277 66c0 f591
+|_SHA-256: d76b 791c e89c 043a c25d 19f3 97b2 91d5 5d94 b1c2 72df 8d1f 4bab fdc1 91a7 413b
With -vv it adds the PEM-encoded contents of the entire
@@ -46,25 +56,26 @@ certificate.
443/tcp open https
-| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
-/stateOrProvinceName=California/countryName=US/1.3.6.1.4.1.311.60.2.1.2=Delaware\
-/postalCode=95131-2021/localityName=San Jose/serialNumber=3014267\
-/streetAddress=2211 N 1st St/1.3.6.1.4.1.311.60.2.1.3=US\
-/organizationalUnitName=PayPal Production/businessCategory=Private Organization
-| Issuer: commonName=VeriSign Class 3 Extended Validation SSL CA\
-/organizationName=VeriSign, Inc./countryName=US\
-/organizationalUnitName=Terms of use at https://www.verisign.com/rpa (c)06
+| ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.
+/stateOrProvinceName=California/countryName=US
+| Subject Alternative Name: DNS:www.paypal.com, DNS:fastlane.paypal.com,
+DNS:secure.paypal.com, DNS:www-st.paypal.com, DNS:connect.paypal.com,
+...
+DNS:es.paypal-qrc.com, DNS:www.fastlane.paypal.com
+| Issuer: commonName=DigiCert SHA2 Extended Validation Server CA
+/organizationName=DigiCert Inc/countryName=US/organizationalUnitName=www.digicert.com
| Public Key type: rsa
| Public Key bits: 2048
-| Signature Algorithm: sha1WithRSAEncryption
-| Not valid before: 2011-03-23 00:00:00
-| Not valid after: 2013-04-01 23:59:59
-| MD5: bf47 ceca d861 efa7 7d14 88ad 4a73 cb5b
-| SHA-1: d846 5221 467a 0d15 3df0 9f2e af6d 4390 0213 9a68
+| Signature Algorithm: sha256WithRSAEncryption
+| Not valid before: 2024-02-08T00:00:00
+| Not valid after: 2025-02-08T23:59:59
+| MD5: 7cc7 a345 a164 dfb1 4690 0277 a540 f636
+| SHA-1: 9269 a100 8f61 aa60 1706 fc85 fd47 d277 66c0 f591
+|_SHA-256: d76b 791c e89c 043a c25d 19f3 97b2 91d5 5d94 b1c2 72df 8d1f 4bab fdc1 91a7 413b
| -----BEGIN CERTIFICATE-----
-| MIIGSzCCBTOgAwIBAgIQLjOHT2/i1B7T//819qTJGDANBgkqhkiG9w0BAQUFADCB
+| MIINmjCCDIKgAwIBAgIQDSuPFewZcdj2USYg2ZUIJzANBgkqhkiG9w0BAQsFADB1
...
-| 9YDR12XLZeQjO1uiunCsJkDIf9/5Mqpu57pw8v1QNA==
+| 6BlCzB65H3ngMIyKoeBQJyV9skuM/mHY/hUsQVIE
|_-----END CERTIFICATE-----
]]
@@ -74,51 +85,94 @@ certificate.
--
-- @output
-- 443/tcp open https
--- | ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.\
+-- | ssl-cert: Subject: commonName=www.paypal.com/organizationName=PayPal, Inc.
-- /stateOrProvinceName=California/countryName=US
--- | Not valid before: 2011-03-23 00:00:00
--- |_Not valid after: 2013-04-01 23:59:59
+-- | Subject Alternative Name: DNS:www.paypal.com, DNS:fastlane.paypal.com,
+-- DNS:secure.paypal.com, DNS:www-st.paypal.com, DNS:connect.paypal.com,
+-- ...
+-- DNS:es.paypal-qrc.com, DNS:www.fastlane.paypal.com
+-- | Not valid before: 2024-02-08T00:00:00
+-- |_Not valid after: 2025-02-08T23:59:59
--
-- @xmloutput
--