]> git.ipfire.org Git - thirdparty/git.git/commit - imap-send.c
imap-send.c: set CURLOPT_USE_SSL to CURLUSESSL_TRY
authorKyle J. McKay <mackyle@gmail.com>
Tue, 6 Jan 2015 11:20:37 +0000 (03:20 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Jan 2015 20:18:32 +0000 (12:18 -0800)
commit230c09c06a7300870f3915c54eff7d9335850a4a
treee87a0e345b2f6336a64a8e0edacd5f186b6a1e4b
parentd47e55da92932eecb58d01a7d925efa36f30087d
imap-send.c: set CURLOPT_USE_SSL to CURLUSESSL_TRY

According to the cURL documentation for the CURLOPT_USE_SSL option,
it is only used with plain text protocols that get upgraded to SSL
using the STARTTLS command.

The server.use_ssl variable is only set when we are using a protocol
that is already SSL/TLS (i.e. imaps), so setting CURLOPT_USE_SSL
when the server.use_ssl variable is set has no effect whatsoever.

Instead, set CURLOPT_USE_SSL to CURLUSESSL_TRY when the server.use_ssl
variable is NOT set so that cURL will attempt to upgrade the plain
text connection to SSL/TLS using STARTTLS in that case.

This much more closely matches the behavior of the non-cURL code path.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c