@@ -1,21 +1,44 @@
---- a/src/event/ngx_event_openssl.c Wed Jul 09 12:27:15 2014 -0700
-+++ b/src/event/ngx_event_openssl.c Tue Jul 15 02:14:39 2014 -0700
+# HG changeset patch
+# User Piotr Sikora <piotr@cloudflare.com>
+# Date 1405415679 25200
+# Tue Jul 15 02:14:39 2014 -0700
+# Node ID 9efeeb95b07de85b8b7bbe50fa2a7e777b722855
+# Parent abd460ece11e9c85d4c0c4a8e6ac46cfb5fa62b5
+SSL: let it build against LibreSSL.
+
+LibreSSL developers decided that LibreSSL is OpenSSL-2.0.0, so tests
+for OpenSSL-1.0.2+ are now passing, even though the library doesn't
+provide functions that we expect from that release of OpenSSL.
+
+Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
+
+diff -r abd460ece11e -r 9efeeb95b07d src/event/ngx_event_openssl.c
+--- a/src/event/ngx_event_openssl.c Wed Jul 09 12:27:15 2014 -0700
++++ b/src/event/ngx_event_openssl.c Tue Jul 15 02:14:39 2014 -0700
@@ -50,7 +50,7 @@ static int ngx_ssl_session_ticket_key_ca
-HMAC_CTX *hctx, int enc);
-#endif
+ HMAC_CTX *hctx, int enc);
+ #endif
+
-#if OPENSSL_VERSION_NUMBER < 0x10002002L
+#if (OPENSSL_VERSION_NUMBER < 0x10002002L || defined LIBRESSL_VERSION_NUMBER)
-static ngx_int_t ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *str);
-#endif
+ static ngx_int_t ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *str);
+ #endif
+
@@ -2733,7 +2733,7 @@ ngx_ssl_check_host(ngx_connection_t *c,
-return NGX_ERROR;
-}
+ return NGX_ERROR;
+ }
+
-#if OPENSSL_VERSION_NUMBER >= 0x10002002L
+#if (OPENSSL_VERSION_NUMBER >= 0x10002002L && !defined LIBRESSL_VERSION_NUMBER)
-/* X509_check_host() is only available in OpenSSL 1.0.2+ */
+
+ /* X509_check_host() is only available in OpenSSL 1.0.2+ */
+
@@ -2850,7 +2850,7 @@ found:
-}
+ }
+
+
-#if OPENSSL_VERSION_NUMBER < 0x10002002L
+#if (OPENSSL_VERSION_NUMBER < 0x10002002L || defined LIBRESSL_VERSION_NUMBER)
-static ngx_int_t
-ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *pattern)
\ No newline at end of file
+
+ static ngx_int_t
+ ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *pattern)
|