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.
This commit is contained in:
Maxim Dounin 2016-10-19 18:36:50 +03:00
parent 94ea39774f
commit 5fcafd251f
2 changed files with 6 additions and 2 deletions

View File

@ -1696,7 +1696,10 @@ ngx_http_upstream_ssl_name(ngx_http_request_t *r, ngx_http_upstream_t *u,
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;

View File

@ -1183,7 +1183,8 @@ ngx_stream_proxy_ssl_name(ngx_stream_session_t *s)
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,