From 9f9c3cbd8d825f80e99ddfdefa530be3955bcd56 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Wed, 26 Oct 2011 00:30:32 +0200 Subject: 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. --- socket.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'socket.c') 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)) { -- cgit v1.2.3