$OpenBSD: patch-configure,v 1.4 2014/10/24 15:01:18 dcoppa Exp $
--- configure.orig	Mon Oct  7 17:13:12 2013
+++ configure	Wed Oct 22 16:32:48 2014
@@ -5742,7 +5742,7 @@ if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssl  $LIBS"
+LIBS="-lcrypto -lssl  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -6209,7 +6209,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 			if test "$PG_SSL" = "yes"
 			then
-				LIBS="${PG_LIB}/libpq.a $CRYPT_LIB $LIBS -lssl $CRYPTO_LIB"
+				LIBS="${PG_LIB}/libpq.a $CRYPT_LIB $LIBS -lcrypto -lssl $CRYPTO_LIB"
 			else
 				LIBS="${PG_LIB}/libpq.a $CRYPT_LIB $LIBS $CRYPTO_LIB"
 			fi
