]> git.ipfire.org Git - thirdparty/curl.git/commit
imap: TLS upgrade fix
authorStefan Eissing <stefan@eissing.org>
Thu, 6 Feb 2025 12:45:01 +0000 (13:45 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 7 Feb 2025 09:13:12 +0000 (10:13 +0100)
commit5c7bf5fe59bab106b3bcc0fdb5ef4e6050a22bf4
tree9568216cc08f43b08eefa97b9f042078e61282da
parentcc256e8f8a30fee2d6655d0475d95a7d8e86297c
imap: TLS upgrade fix

There were two places in the code that tried to connect the SSL filter,
e.g. do the TLS handshake, but only one changed imap state to CAPA
afterwards.

Depending on timing, the wrong path was taken and the connection was
hanging, waiting for a server reply to a command not sent.

Do the upgrade to tls in one place and update connection filter and
smtps protocol handler at the same time. Always transition to CAPA on
success.

Closes #16213
lib/imap.c