From 32a764399bed6e64b6f03578025bf4255cc63183 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 28 Feb 2003 21:55:06 +0000 Subject: Same as IMAP and POP. 2003-02-28 Jeffrey Stedfast * providers/smtp/camel-smtp-transport.c (connect_to_server): Same as IMAP and POP. * providers/imap/camel-imap-store.c (connect_to_server): Same as the POP3 code. * providers/pop3/camel-pop3-store.c (connect_to_server): Pass in appropriate flags for camel_tcp_stream_ssl_new*() functions. * camel-tcp-stream-ssl.c (enable_ssl): Not all ssl/tls streams will want to allow each of SSLv2, SSLv3 and TLSv1 so use flags to decide which to enable/disable. (camel_tcp_stream_ssl_new): Now takes a flags argument to mask out which SSL/TLS versions the stream should be compatable with. (camel_tcp_stream_ssl_new_raw): Same. svn path=/trunk/; revision=20111 --- camel/providers/imap/camel-imap-store.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'camel/providers/imap/camel-imap-store.c') diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 0537eaf0d9..b94751625d 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -544,6 +544,9 @@ enum { USE_SSL_WHEN_POSSIBLE }; +#define SSL_PORT_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_SSL2 | CAMEL_TCP_STREAM_SSL_ENABLE_SSL3) +#define STARTTLS_FLAGS (CAMEL_TCP_STREAM_SSL_ENABLE_TLS) + static gboolean connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelException *ex) { @@ -563,11 +566,11 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE #ifdef HAVE_SSL if (ssl_mode != USE_SSL_NEVER) { - if (try_starttls) - tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host); - else { + if (try_starttls) { + tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host, STARTTLS_FLAGS); + } else { port = service->url->port ? service->url->port : 993; - tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host); + tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host, SSL_PORT_FLAGS); } } else { tcp_stream = camel_tcp_stream_raw_new (); -- cgit v1.2.3