--- configure.in.orig	2009-05-13 14:01:51.034361500 +0200
+++ configure.in	2009-05-13 14:11:41.978361500 +0200
@@ -1216,15 +1216,25 @@
 	if test $ac_cv_header_openssl_ssl_h = yes ; then
 		AC_CHECK_LIB(ssl, SSL_library_init,
 			[have_openssl=yes
-			need_rsaref=no], [have_openssl=no],
+			need_rsaref=no
+			need_gdi32=no], [have_openssl=no],
 			[-lcrypto])
 
 		if test $have_openssl = no ; then
 			AC_CHECK_LIB(ssl, ssl3_accept, 
 				[have_openssl=yes
-				need_rsaref=yes], [have_openssl=no],
+				need_rsaref=yes
+				need_gdi32=no], [have_openssl=no],
 				[-lcrypto -lRSAglue -lrsaref])
 		fi
+		
+		if test $have_openssl = no ; then
+			AC_CHECK_LIB(ssl, ssl3_connect, 
+				[have_openssl=yes
+				need_rsaref=no
+				need_gdi32=yes], [have_openssl=no],
+				[-lcrypto -lgdi32])
+		fi		
 
 		if test $have_openssl = yes ; then
 			ol_with_tls=openssl
@@ -1238,6 +1248,8 @@
 					[define if OpenSSL needs RSAref])
 
 				TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
+			elif test $need_gdi32 = yes ; then
+				TLS_LIBS="-lssl -lcrypto -lgdi32"
 			else
 				TLS_LIBS="-lssl -lcrypto"
 			fi
