[PATCH 1 of 1] Upstream: fix warning when building with BoringSSL
Alessandro Ghedini
alessandro at cloudflare.com
Wed Sep 28 14:10:47 UTC 2016
# HG changeset patch
# User Alessandro Ghedini <alessandro at cloudflare.com>
# Date 1475070884 -3600
# Wed Sep 28 14:54:44 2016 +0100
# Node ID 8c3706ffdc9bde38ef5035b5f2fa9979cf1ea4da
# Parent 29bf0dbc0a77914bc94bd001a2b17d364e8e50d9
Upstream: fix warning when building with BoringSSL
BoringSSL takes a const u_char * for SSL_set_tlsext_host_name but
OpenSSL only takes a u_char *. Since NGINX is built with -Werror by
default this breaks the build.
diff -r 29bf0dbc0a77 -r 8c3706ffdc9b src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Thu Sep 22 19:32:47 2016 +0300
+++ b/src/http/ngx_http_upstream.c Wed Sep 28 14:54:44 2016 +0100
@@ -1696,7 +1696,12 @@
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"upstream SSL server name: \"%s\"", name.data);
+#ifdef OPENSSL_IS_BORINGSSL
+ if (SSL_set_tlsext_host_name(c->ssl->connection,
+ (const char *) name.data) == 0) {
+#else
if (SSL_set_tlsext_host_name(c->ssl->connection, name.data) == 0) {
+#endif
ngx_ssl_error(NGX_LOG_ERR, r->connection->log, 0,
"SSL_set_tlsext_host_name(\"%s\") failed", name.data);
return NGX_ERROR;
More information about the nginx-devel
mailing list