aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2011-10-26 00:30:32 +0200
committerMatthias Andree <matthias.andree@gmx.de>2011-10-26 00:33:26 +0200
commit9f9c3cbd8d825f80e99ddfdefa530be3955bcd56 (patch)
tree0a7c36422cfed7696b28ec262a1d65071edba36a /socket.c
parent514239e63f18708b86d41db7fa78f49714b10c29 (diff)
downloadfetchmail-9f9c3cbd8d825f80e99ddfdefa530be3955bcd56.tar.gz
fetchmail-9f9c3cbd8d825f80e99ddfdefa530be3955bcd56.tar.bz2
fetchmail-9f9c3cbd8d825f80e99ddfdefa530be3955bcd56.zip
Fix build on SSLv2-disabled OpenSSL setups
On systems where SSLv2_client_method isn't defined in OpenSSL (such as newer Debian, and Ubuntu starting with 11.10 oneiric ocelot), don't reference it (to fix the build) and print a run-time error that the OS does not support SSLv2. Fixes Debian Bug #622054, but note that that bug report has a more thorough patch that does away with SSLv2 altogether.
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/socket.c b/socket.c
index d2004819..260b0aa3 100644
--- a/socket.c
+++ b/socket.c
@@ -874,7 +874,12 @@ int SSLOpen(int sock, char *mycert, char *mykey, const char *myproto, int certck
_ssl_context[sock] = NULL;
if(myproto) {
if(!strcasecmp("ssl2",myproto)) {
+#if HAVE_DECL_SSLV2_CLIENT_METHOD + 0 > 0
_ctx[sock] = SSL_CTX_new(SSLv2_client_method());
+#else
+ report(stderr, GT_("Your operating system does not support SSLv2.\n"));
+ return -1;
+#endif
} else if(!strcasecmp("ssl3",myproto)) {
_ctx[sock] = SSL_CTX_new(SSLv3_client_method());
} else if(!strcasecmp("tls1",myproto)) {