diff options
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 11 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 11 | ||||
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 11 |
3 files changed, 21 insertions, 12 deletions
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 (); diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index f0928ea4cc..a8c693b168 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -141,6 +141,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) { @@ -159,11 +162,11 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelE #ifdef HAVE_SSL if (camel_url_get_param (service->url, "use_ssl")) { - 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 : 995; - 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 (); diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index d43f5c6e38..57e1b52779 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -228,6 +228,9 @@ smtp_error_string (int error) } } +#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 try_starttls, CamelException *ex) { @@ -252,11 +255,11 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex) #ifdef HAVE_SSL if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL) { - 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 : 465; - 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 (); |