CLEANUP: ssl: make inclusion of openssl headers safe

It's always a pain to have to stuff lots of #ifdef USE_OPENSSL around
ssl headers, it even results in some of them appearing in a random order
and multiple times just to benefit form an existing ifdef block. Let's
make these headers safe for inclusion when USE_OPENSSL is not defined,
they now perform the test themselves and do nothing if USE_OPENSSL is
not defined. This allows to remove no less than 8 such ifdef blocks
and make include blocks more readable.
diff --git a/include/common/openssl-compat.h b/include/common/openssl-compat.h
index 0ceca08..55d874d 100644
--- a/include/common/openssl-compat.h
+++ b/include/common/openssl-compat.h
@@ -1,5 +1,6 @@
 #ifndef _COMMON_OPENSSL_COMPAT_H
 #define _COMMON_OPENSSL_COMPAT_H
+#ifdef USE_OPENSSL
 
 #include <openssl/bn.h>
 #include <openssl/crypto.h>
@@ -233,4 +234,5 @@
 #define TLS_TICKET_HASH_FUNCT EVP_sha256
 #endif /* OPENSSL_NO_SHA256 */
 
+#endif /* USE_OPENSSL */
 #endif /* _COMMON_OPENSSL_COMPAT_H */
diff --git a/include/proto/ssl_sock.h b/include/proto/ssl_sock.h
index f3d3ff8..23507ca 100644
--- a/include/proto/ssl_sock.h
+++ b/include/proto/ssl_sock.h
@@ -21,6 +21,8 @@
 
 #ifndef _PROTO_SSL_SOCK_H
 #define _PROTO_SSL_SOCK_H
+#ifdef USE_OPENSSL
+
 #include <common/openssl-compat.h>
 
 #include <types/connection.h>
@@ -28,6 +30,8 @@
 #include <types/proxy.h>
 #include <types/stream_interface.h>
 
+#include <proto/connection.h>
+
 extern int sslconns;
 extern int totalsslconns;
 
@@ -99,6 +103,7 @@
 
 #define sh_ssl_sess_tree_lookup(k)     (struct sh_ssl_sess_hdr *)ebmb_lookup(sh_ssl_sess_tree, \
                                                                     (k), SSL_MAX_SSL_SESSION_ID_LENGTH);
+#endif /* USE_OPENSSL */
 #endif /* _PROTO_SSL_SOCK_H */
 
 /*
diff --git a/include/types/server.h b/include/types/server.h
index 2951cf6..0d53d26 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -25,14 +25,10 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#ifdef USE_OPENSSL
-#include <common/openssl-compat.h>
-#include <types/ssl_sock.h>
-#endif
-
 #include <common/config.h>
 #include <common/mini-clist.h>
 #include <common/hathreads.h>
+#include <common/openssl-compat.h>
 
 #include <eb32tree.h>
 
@@ -43,6 +39,7 @@
 #include <types/obj_type.h>
 #include <types/proxy.h>
 #include <types/queue.h>
+#include <types/ssl_sock.h>
 #include <types/task.h>
 #include <types/checks.h>
 
diff --git a/include/types/ssl_sock.h b/include/types/ssl_sock.h
index 45f89c9..0c86357 100644
--- a/include/types/ssl_sock.h
+++ b/include/types/ssl_sock.h
@@ -21,6 +21,7 @@
 
 #ifndef _TYPES_SSL_SOCK_H
 #define _TYPES_SSL_SOCK_H
+#ifdef USE_OPENSSL
 
 #include <ebmbtree.h>
 
@@ -84,4 +85,5 @@
 	unsigned char key_data[SSL_MAX_SSL_SESSION_ID_LENGTH];
 };
 
+#endif /* USE_OPENSSL */
 #endif /* _TYPES_SSL_SOCK_H */