How to verify client SSL connection with OpenSSL

Categorysysadmin
Tags
Created

How to verify client SSL connection with OpenSSL

To verify the connection we will connect OpenSSL to the client offering SSL port that we want to check with the following command.

bash
openssl s_client -connect host:port

Example with google.com

bash
$ openssl s_client -connect google.com:443 CONNECTED(000001AC) depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1 verify return:1 depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3 verify return:1 depth=0 CN = *.google.com verify return:1 --- Certificate chain 0 s:CN = *.google.com i:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3 1 s:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3 i:C = US, O = Google Trust Services LLC, CN = GTS Root R1 2 s:C = US, O = Google Trust Services LLC, CN = GTS Root R1 i:C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA --- Server certificate -----BEGIN CERTIFICATE----- MIIN1TCCDL2gAwIBAgIQRHk2Kk6S7LsSAAAAAAXwgDANBgkqhkiG9w0BAQsFADBG MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM QzETMBEGA1UEAxMKR1RTIENBIDFDMzAeFw0yMjAzMjEwMjIyNDZaFw0yMjA2MTMw MjIyNDVaMBcxFTATBgNVBAMMDCouZ29vZ2xlLmNvbTBZMBMGByqGSM49AgEGCCqG SM49AwEHA0IABCxNvVbzAYuhQo57RMPPbLhkhjcTONi6h+dbsmhyMnreU+mjQwPF plgf7dliILLg5+avsyn9YKIkPXgYMs6Wdi2jggu3MIILszAOBgNVHQ8BAf8EBAMC B4AwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU n6IrY43W4zC3jbzl+4JRVDqt0I0wHwYDVR0jBBgwFoAUinR/r4XN7pXNPZzQ4kYU 83E1HScwagYIKwYBBQUHAQEEXjBcMCcGCCsGAQUFBzABhhtodHRwOi8vb2NzcC5w a2kuZ29vZy9ndHMx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5kcm9pZC5nb29nbGUuY24wIQYDVR0gBBowGDAIBgZngQwB AgEwDAYKKwYBBAHWeQIFAzA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8vY3Jscy5w a2kuZ29vZy9ndHMxYzMvZlZKeGJWLUt0bWsuY3JsMIIBAwYKKwYBBAHWeQIEAgSB 9ASB8QDvAHUA36Veq2iCTx9sre64X04+WurNohKkal6OOxLAIERcKnMAAAF/qn/I 8gAABAMARjBEAiBJobYPyyLcc8m22VklCBIn32wmYMpzr0Uap1936aw/UwIgN8HS WMVNcbcWmZaHAxLpgbDLBo/IR4CJPfmXPjMXJQMAdgBGpVXrdfqRIDC1oolp9PN9 ESxBdL79SbiFq/L8cP5tRwAAAX+qf8rZAAAEAwBHMEUCIHwb+kIM1/cKdzUI/7Yp cZj9NouoRarDGUb6Rr6EIeusAiEAz7NaRRtrBfYGvLhXNX3XYjrCqOQq5yZzI4O/ dQJy2JAwDQYJKoZIhvcNAQELBQADggEBABhO5XE9lidz5E/DT+L4JRl2W1SsQXy/ Xfl8HUt8ZLd/hWHDtKsxu9NYGlAaqZDWQzOsfqyOcysjgsRaCe/H13CRYONFAfDx iBCc3FglMtBP+CmclKXGOvb3SfEpoqJHSOEI7Wi0l2s/3t89fUs5pC7lKHQBzQtd mie59fBPrJvYrRZCetXJGpid6t2WwBmOAgxzOnxnPzM1TykbPEyPsqX03Lgv71Hc L7bKdKx5dm2DzGwxkbokopH3Xxshfl+UlxKOHFA7SNMklPVc8zGDHsv+aj0UywpW Ny68R+TWEZgRin8TDBCjKh4qVG4yB0dVjc7c0BoFL8WiPtxP4KDnmsg= -----END CERTIFICATE----- subject=CN = *.google.com issuer=C = US, O = Google Trust Services LLC, CN = GTS CA 1C3 --- No client certificate CA names sent Peer signing digest: SHA256 Peer signature type: ECDSA Server Temp Key: X25519, 253 bits --- SSL handshake has read 6676 bytes and written 392 bytes Verification: OK --- New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384 Server public key is 256 bit Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE No ALPN negotiated Early data was not sent Verify return code: 0 (ok) ---