From 06cdc97da50363e0258f513c18b65d3956b603d1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 2 Oct 2019 23:57:47 +0900 Subject: [PATCH] Send SNI --- src/h2load.cc | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index d5a48e5d..9654a295 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -512,27 +512,29 @@ int Client::make_socket(addrinfo *addr) { std::cerr << "quic_init failed" << std::endl; return -1; } - - return 0; - } - - fd = util::create_nonblock_socket(addr->ai_family); - if (fd == -1) { - return -1; - } - if (config.scheme == "https") { - if (!ssl) { - ssl = SSL_new(worker->ssl_ctx); + } else { + fd = util::create_nonblock_socket(addr->ai_family); + if (fd == -1) { + return -1; } + if (config.scheme == "https") { + if (!ssl) { + ssl = SSL_new(worker->ssl_ctx); + } - SSL_set_fd(ssl, fd); - SSL_set_connect_state(ssl); + SSL_set_fd(ssl, fd); + SSL_set_connect_state(ssl); + } } if (ssl && !util::numeric_host(config.host.c_str())) { SSL_set_tlsext_host_name(ssl, config.host.c_str()); } + if (config.is_quic()) { + return 0; + } + rv = ::connect(fd, addr->ai_addr, addr->ai_addrlen); if (rv != 0 && errno != EINPROGRESS) { if (ssl) {