Ticket #229: patch_ngx_http_upstream_ssl_init_connection_SNI.diff
| File patch_ngx_http_upstream_ssl_init_connection_SNI.diff, 1.1 KB (added by , 14 years ago) |
|---|
-
src/http/ngx_http_upstream.c
1251 1251 NGX_HTTP_INTERNAL_SERVER_ERROR); 1252 1252 return; 1253 1253 } 1254 1255 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME 1256 if (u->resolved) { 1257 char *host = (char*) malloc(sizeof(char) * u->resolved->host.len + 1); 1258 memset(host, 0, u->resolved->host.len + 1); 1259 memcpy(host, u->resolved->host.data, sizeof(char) * u->resolved->host.len); 1254 1260 1261 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, 1262 "http upstream set tlsext host name \"%s.\"", host); 1263 1264 if (!SSL_set_tlsext_host_name(c->ssl->connection,host)) 1265 { 1266 ngx_log_error(NGX_LOG_WARN, c->log, 0, 1267 "SSL_set_tlsext_host_name(\"%s\") failed", u->conf->upstream->host.data ); 1268 } 1269 free(host); 1270 } 1271 #endif 1272 1255 1273 c->sendfile = 0; 1256 1274 u->output.sendfile = 0; 1257 1275
