$OpenBSD: patch-configure,v 1.5 2016/07/15 14:43:40 pea Exp $
--- configure.orig	Mon Feb  8 02:27:13 2016
+++ configure	Sat Jul  2 17:10:19 2016
@@ -5743,7 +5743,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.  */
 
@@ -6210,7 +6210,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
