nxt_openssl.c (1920:7c19530e2502) nxt_openssl.c (1921:b0deb6fa9219)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_conf.h>

--- 790 unchanged lines hidden (view full) ---

799 c = SSL_get_ex_data(s, nxt_openssl_connection_index);
800
801 if (nxt_slow_path(c == NULL)) {
802 nxt_thread_log_alert("SSL_get_ex_data() failed");
803 return SSL_TLSEXT_ERR_ALERT_FATAL;
804 }
805
806 servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_conf.h>

--- 790 unchanged lines hidden (view full) ---

799 c = SSL_get_ex_data(s, nxt_openssl_connection_index);
800
801 if (nxt_slow_path(c == NULL)) {
802 nxt_thread_log_alert("SSL_get_ex_data() failed");
803 return SSL_TLSEXT_ERR_ALERT_FATAL;
804 }
805
806 servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
807 if (nxt_slow_path(servername == NULL)) {
808 nxt_log(c->socket.task, NXT_LOG_ALERT, "SSL_get_servername() returned "
809 "NULL in server name callback");
810 return SSL_TLSEXT_ERR_ALERT_FATAL;
807
808 if (servername == NULL) {
809 nxt_debug(c->socket.task, "SSL_get_servername(): NULL");
810 goto done;
811 }
812
813 str.length = nxt_strlen(servername);
814 if (str.length == 0) {
811 }
812
813 str.length = nxt_strlen(servername);
814 if (str.length == 0) {
815 nxt_debug(c->socket.task, "client sent zero-length server name");
815 nxt_debug(c->socket.task, "SSL_get_servername(): \"\" is empty");
816 goto done;
817 }
818
819 if (servername[0] == '.') {
820 nxt_debug(c->socket.task, "ignored the server name \"%s\": "
821 "leading \".\"", servername);
822 goto done;
823 }

--- 744 unchanged lines hidden ---
816 goto done;
817 }
818
819 if (servername[0] == '.') {
820 nxt_debug(c->socket.task, "ignored the server name \"%s\": "
821 "leading \".\"", servername);
822 goto done;
823 }

--- 744 unchanged lines hidden ---