aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/driver.c b/driver.c
index 950830f0..38475016 100644
--- a/driver.c
+++ b/driver.c
@@ -1556,7 +1556,11 @@ const int maxfetch; /* maximum number of messages to fetch */
phase = OPEN_WAIT;
set_timeout(mytimeout);
#if !INET6
+#ifdef SSL_ENABLE
+ port = ctl->server.port ? ctl->server.port : ( ctl->use_ssl ? protocol->sslport : protocol->port );
+#else
port = ctl->server.port ? ctl->server.port : protocol->port;
+#endif
#endif /* !INET6 */
realhost = ctl->server.via ? ctl->server.via : ctl->server.pollname;
@@ -1615,6 +1619,17 @@ const int maxfetch; /* maximum number of messages to fetch */
set_timeout(0);
phase = oldphase;
+#ifdef SSL_ENABLE
+ /* perform initial SSL handshake on open connection */
+ /* Note: We pass the realhost name over for certificate
+ verification. We may want to make this configurable */
+ if (ctl->use_ssl && SSLOpen(mailserver_socket,ctl->sslkey,ctl->sslcert,realhost) == -1)
+ {
+ report(stderr, "SSL connection failed.");
+ goto closeUp;
+ }
+#endif
+
#ifdef KERBEROS_V4
if (ctl->server.preauthenticate == A_KERBEROS_V4)
{