I'm running Stunnel 5.56 under Windows 10 v1909 x64.
I have uncovered a case in which VerifyPeer = yes is not working. What's happening is that the locally installed certificate is old and expired, and does not match the current, up-to-date server certificate, yet Stunnel is letting it pass and verifying okay. I've pasted the certificates, config, and log below, and clearly the certificates are different.
Regards,
Thomas
From my config file:
debug = 7 delay = yes socket = l:TCP_NODELAY=1 socket = r:TCP_NODELAY=1 socket = l:SO_LINGER=1:60 socket = r:SO_LINGER=1:60
[ircs.3] client = yes sslVersionMin = TLSv1.2 cafile = peer-ircs.3.pem verifyPeer = yes accept = 127.0.0.1:8909 connect = halcyon.il.us.dal.net:6697
From the Stunnel log:
2020.02.04 12:41:50 LOG5[9]: Service [ircs.3] connected remote server from 104.231.234.35:62290 2020.02.04 12:41:50 LOG7[9]: Setting remote socket options (FD=1012) 2020.02.04 12:41:50 LOG7[9]: Option SO_LINGER set on remote socket 2020.02.04 12:41:50 LOG7[9]: Option TCP_NODELAY set on remote socket 2020.02.04 12:41:50 LOG7[9]: Remote descriptor (FD=1012) initialized 2020.02.04 12:41:50 LOG6[9]: SNI: sending servername: halcyon.il.us.dal.net 2020.02.04 12:41:50 LOG6[9]: Peer certificate required 2020.02.04 12:41:50 LOG7[9]: TLS state (connect): before SSL initialization 2020.02.04 12:41:50 LOG7[9]: TLS state (connect): SSLv3/TLS write client hello 2020.02.04 12:41:50 LOG7[9]: TLS state (connect): SSLv3/TLS write client hello 2020.02.04 12:41:50 LOG7[9]: TLS state (connect): SSLv3/TLS read server hello 2020.02.04 12:41:50 LOG7[9]: TLS state (connect): TLSv1.3 read encrypted extensions 2020.02.04 12:41:50 LOG7[9]: Verification started at depth=1: C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 2020.02.04 12:41:50 LOG6[9]: CERT: Pre-verification error ignored: unable to get issuer certificate 2020.02.04 12:41:50 LOG6[9]: Certificate accepted at depth=1: C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 2020.02.04 12:41:50 LOG7[9]: Verification started at depth=0: CN=*.dal.net 2020.02.04 12:41:50 LOG7[9]: CERT: Pre-verification succeeded 2020.02.04 12:41:50 LOG6[9]: CERT: No subject checks configured 2020.02.04 12:41:50 LOG6[9]: CERT: Locally installed certificate matched 2020.02.04 12:41:50 LOG5[9]: Certificate accepted at depth=0: CN=*.dal.net
Here is the locally installed certificate:
-----BEGIN CERTIFICATE----- MIIFeDCCBGCgAwIBAgISA4aqIgapILZTQatLgMyS1gJ7MA0GCSqGSIb3DQEBCwUA MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xOTA2MDEwNDEzMjlaFw0x OTA4MzAwNDEzMjlaMBQxEjAQBgNVBAMMCSouZGFsLm5ldDCCASIwDQYJKoZIhvcN AQEBBQADggEPADCCAQoCggEBAKk+ZRY6Kr4GUS9hU+AUvgUrRzffLS4ScDNvk88F HXKe6Yx3oJnMJEGC9a5I9nJATcItOa+Xk6NKFIsGQZhFOTkV9xvbaEw2KZ14SIKK NsffEqZeQ/TUdMaHTeDXJxj1gfa+W9FK6uO1TzKrYQamdegXAv55F6KLeIPTjZj3 77AkdWuddimY3rp0gK/R1e2tkFtP/0ZeWuu1M736b6dtjXFIhzw3G8wurbGfBgfO TebZL3Kw0X5qOlyMQyOyXXUyRZMqgW7PMloGtGQ/PJKoTzqNmyWO93QB28PGHDm8 WgnSdwgXlTmVrL9Vwnzb5FIfcM1ba5nzqDGeg7tG5RcQEGkCAwEAAaOCAowwggKI MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw DAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUpVm+qZ/cdM/H1vr7emXvf14+/0AwHwYD VR0jBBgwFoAUqEpqYwR93brm0Tm3pkVl7/Oo7KEwbwYIKwYBBQUHAQEEYzBhMC4G CCsGAQUFBzABhiJodHRwOi8vb2NzcC5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gL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/ wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6 KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg== -----END CERTIFICATE-----
Here is the remote server certificate:
-----BEGIN CERTIFICATE----- MIIFeTCCBGGgAwIBAgISBMC6zEv90htsFIzCbGOKGCpvMA0GCSqGSIb3DQEBCwUA MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0yMDAxMjgwNTIzMjFaFw0y MDA0MjcwNTIzMjFaMBQxEjAQBgNVBAMMCSouZGFsLm5ldDCCASIwDQYJKoZIhvcN AQEBBQADggEPADCCAQoCggEBAKk+ZRY6Kr4GUS9hU+AUvgUrRzffLS4ScDNvk88F HXKe6Yx3oJnMJEGC9a5I9nJATcItOa+Xk6NKFIsGQZhFOTkV9xvbaEw2KZ14SIKK NsffEqZeQ/TUdMaHTeDXJxj1gfa+W9FK6uO1TzKrYQamdegXAv55F6KLeIPTjZj3 77AkdWuddimY3rp0gK/R1e2tkFtP/0ZeWuu1M736b6dtjXFIhzw3G8wurbGfBgfO TebZL3Kw0X5qOlyMQyOyXXUyRZMqgW7PMloGtGQ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