From 0d1e69ae10af5eba7cd3426e802d40d17b6db218 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 27 Oct 1999 00:15:14 +0000 Subject: This preliminary SSL patch goes to Mike. svn path=/trunk/; revision=2643 --- driver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'driver.c') 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) { -- cgit v1.2.3