mirror of https://github.com/aria2/aria2
Don't set SNI hostname if it does not include "." for GNUTLS
parent
393d0d9fbc
commit
0030025bb6
|
@ -986,7 +986,10 @@ bool SocketCore::initiateSecureConnection(const std::string& hostname)
|
||||||
switch(secure_) {
|
switch(secure_) {
|
||||||
case A2_TLS_INITIALIZED:
|
case A2_TLS_INITIALIZED:
|
||||||
secure_ = A2_TLS_HANDSHAKING;
|
secure_ = A2_TLS_HANDSHAKING;
|
||||||
if(!util::isNumericHost(hostname)) {
|
// Check hostname is not numeric and it includes ".". Setting
|
||||||
|
// "localhost" will produce TLS alert.
|
||||||
|
if(!util::isNumericHost(hostname) &&
|
||||||
|
hostname.find(".") != std::string::npos) {
|
||||||
// TLS extensions: SNI
|
// TLS extensions: SNI
|
||||||
int ret = gnutls_server_name_set(sslSession_, GNUTLS_NAME_DNS,
|
int ret = gnutls_server_name_set(sslSession_, GNUTLS_NAME_DNS,
|
||||||
hostname.c_str(), hostname.size());
|
hostname.c_str(), hostname.size());
|
||||||
|
|
Loading…
Reference in New Issue