From 903e0077aa453f2d14ef8bcba4851901cb15feb9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 27 Jun 2016 22:29:07 +0900 Subject: [PATCH] nghttpx: Fix build error with libressl --- src/shrpx_ssl.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index c14ff605..fa09e137 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -1371,12 +1371,14 @@ SSL_CTX *setup_server_ssl_context(std::vector &all_ssl_ctx, return ssl_ctx; } -#if OPENSSL_VERSION_NUMBER >= 0x10002000L +#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10002000L auto cert = SSL_CTX_get0_certificate(ssl_ctx); -#else // OPENSSL_VERSION_NUMBER < 0x10002000L +#else // defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < + // 0x10002000L auto cert = load_certificate(tlsconf.cert_file.c_str()); auto cert_deleter = defer(X509_free, cert); -#endif // OPENSSL_VERSION_NUMBER < 0x10002000L +#endif // defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < + // 0x10002000L if (ssl::cert_lookup_tree_add_cert_from_x509( cert_tree, all_ssl_ctx.size() - 1, cert) == -1) { @@ -1397,12 +1399,14 @@ SSL_CTX *setup_server_ssl_context(std::vector &all_ssl_ctx, ); all_ssl_ctx.push_back(ssl_ctx); -#if OPENSSL_VERSION_NUMBER >= 0x10002000L +#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10002000L auto cert = SSL_CTX_get0_certificate(ssl_ctx); -#else // OPENSSL_VERSION_NUMBER < 0x10002000L +#else // defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < + // 0x10002000L auto cert = load_certificate(cert_file.c_str()); auto cert_deleter = defer(X509_free, cert); -#endif // OPENSSL_VERSION_NUMBER < 0x10002000L +#endif // defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < + // 0x10002000L if (ssl::cert_lookup_tree_add_cert_from_x509( cert_tree, all_ssl_ctx.size() - 1, cert) == -1) {