changeset 6777:563a1ee345a4

SSL: compatibility with BoringSSL. BoringSSL changed SSL_set_tlsext_host_name() to be a real function with a (const char *) argument, so it now triggers a warning due to conversion from (u_char *). Added an explicit cast to silence the warning. Prodded by Piotr Sikora, Alessandro Ghedini.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 19 Oct 2016 18:36:50 +0300
parents 1bf4f21b1b72
children 5e95b9fb33b7
files src/http/ngx_http_upstream.c src/stream/ngx_stream_proxy_module.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c	Tue Oct 18 16:33:38 2016 +0300
+++ b/src/http/ngx_http_upstream.c	Wed Oct 19 18:36:50 2016 +0300
@@ -1696,7 +1696,10 @@
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                    "upstream SSL server name: \"%s\"", name.data);
 
-    if (SSL_set_tlsext_host_name(c->ssl->connection, name.data) == 0) {
+    if (SSL_set_tlsext_host_name(c->ssl->connection,
+                                 (char *) name.data)
+        == 0)
+    {
         ngx_ssl_error(NGX_LOG_ERR, r->connection->log, 0,
                       "SSL_set_tlsext_host_name(\"%s\") failed", name.data);
         return NGX_ERROR;
--- a/src/stream/ngx_stream_proxy_module.c	Tue Oct 18 16:33:38 2016 +0300
+++ b/src/stream/ngx_stream_proxy_module.c	Wed Oct 19 18:36:50 2016 +0300
@@ -1183,7 +1183,8 @@
     ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0,
                    "upstream SSL server name: \"%s\"", name.data);
 
-    if (SSL_set_tlsext_host_name(u->peer.connection->ssl->connection, name.data)
+    if (SSL_set_tlsext_host_name(u->peer.connection->ssl->connection,
+                                 (char *) name.data)
         == 0)
     {
         ngx_ssl_error(NGX_LOG_ERR, s->connection->log, 0,