I am trying to connect Outlook 2019 to a Cyrus imapd server, using an SSL connection on port 993, and using ECDHE for key agreement. Whatever I do, this does not work although the imap server is set up correctly.
To debug the problem, I issued ssldump -a -A -H -i enp0s3 on the server and watched its output when Outlook tries to connect (I have left away the most part of the cipher suite list in the first C -> S handshake for brevity):
New TCP connection #1: odo.lab.example.de(58717) <-> morn.lab.example.de(993) 1 1 0.0019 (0.0019) C>S V3.3(178) Handshake ClientHello Version 3.3 random[32]= 65 b1 2e 3c bb 7c 4d 04 03 0e 34 49 62 48 e5 d9 22 c6 c9 c7 22 d4 e5 a0 76 44 64 9b a3 9d d5 bf cipher suites TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ... compression methods NULL extensions server_name host_name: imap.lab.example.de supported_groups ec_point_formats signature_algorithms session_ticket extended_master_secret renegotiation_info 1 2 0.1245 (0.1225) S>C V3.3(69) Handshake ServerHello Version 3.3 random[32]= 3c ef 0c 80 c8 c2 35 85 90 20 8e 6f f4 e0 93 fe 78 60 32 23 11 ec 56 df 3f f3 c6 e2 14 2f e5 2b session_id[0]= cipherSuite TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 compressionMethod NULL extensions renegotiation_info server_name ec_point_formats session_ticket extended_master_secret 1 3 0.1245 (0.0000) S>C V3.3(1291) Handshake Certificate 1 4 0.1245 (0.0000) S>C V3.3(333) Handshake ServerKeyExchange params Not enough data. Found 327 bytes (expecting 32767) 1 5 0.1245 (0.0000) S>C V3.3(4) Handshake ServerHelloDone 1 0.1254 (0.0009) C>S TCP FIN 1 0.1257 (0.0002) S>C TCP FIN As we can see, the client and the server agree on the desired cipher (TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384). Next, the server seems to send its certificate to the client (it is a self-signed certificate, but this is not the problem because I have added that certificate to the trusted root CAs in Windows).
But next, there seems to be a problem with the key exchange: Not enough data. Found 327 bytes (expecting 32767) For the life of me and despite having put nearly a day into it, I can't figure out what it means and how to solve it.
Originally, I thought that it might have to do with DH parameters that are missing in the certificate file. However, (EC)DHE doesn't need such parameters because it's just the purpose of the ephemeral version to compute them dynamically and replace them regularly.
Do I need to add additional info to the key or the certificate that the IMAP server uses? It wouldn't be a problem if I had to create new ones.
I have assigned the openssl tag to this question because Cyrus imapd uses OpenSSL for SSL / TLS encryption. The OpenSSL version on the server is 1.1.1w.
I also have made sure that Outlook (the Windows side) uses TLS 1.2. This is reflected in the console output shown above (Version 3.3 means TLS 1.2).
ssldump.