Index: src/network.c
===================================================================
--- src/network.c	(revision 2824)
+++ src/network.c	(revision 2825)
@@ -25,6 +25,14 @@
 # include <openssl/ssl.h>
 # include <openssl/err.h>
 # include <openssl/rand.h>
+# include <openssl/dh.h>
+# include <openssl/bn.h>
+
+# if OPENSSL_VERSION_NUMBER >= 0x0090800fL
+#  ifndef OPENSSL_NO_ECDH
+# include <openssl/ecdh.h>
+#  endif
+# endif
 #endif
 
 #ifdef USE_OPENSSL
