From 8d0b4544f8ff9e8064b70f2daf38f26e815c8703 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 14 Apr 2018 18:04:32 +0900 Subject: [PATCH] libressl 2.7 has X509_VERIFY_PARAM_* --- src/nghttp.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index ca4a02a4..4f05d6c0 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -59,6 +59,7 @@ #include "base64.h" #include "tls.h" #include "template.h" +#include "ssl_compat.h" #ifndef O_BINARY #define O_BINARY (0) @@ -680,15 +681,16 @@ int HttpClient::initiate_connection() { const auto &host_string = config.host_override.empty() ? host : config.host_override; -#if (!defined(LIBRESSL_VERSION_NUMBER) && \ - OPENSSL_VERSION_NUMBER >= 0x10002000L) || \ +#if LIBRESSL_2_7_API || \ + (!LIBRESSL_IN_USE && OPENSSL_VERSION_NUMBER >= 0x10002000L) || \ defined(OPENSSL_IS_BORINGSSL) auto param = SSL_get0_param(ssl); X509_VERIFY_PARAM_set_hostflags(param, 0); X509_VERIFY_PARAM_set1_host(param, host_string.c_str(), host_string.size()); -#endif // (!defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= - // 0x10002000L) || defined(OPENSSL_IS_BORINGSSL) +#endif // LIBRESSL_2_7_API || (!LIBRESSL_IN_USE && + // OPENSSL_VERSION_NUMBER >= 0x10002000L) || + // defined(OPENSSL_IS_BORINGSSL) SSL_set_verify(ssl, SSL_VERIFY_PEER, verify_cb); if (!util::numeric_host(host_string.c_str())) {