Use TLS with a certificate validation. Certification authority certificates
are loaded from the specified PEM file (default is system certificate storage
if no argument is provided).
-Can be specified multiple times. Provide the +tls\-hostname option to activate
-strict authentication.
+Can be specified multiple times. If the +tls\-hostname option is not provided,
+the name of the target server (if specified) is used for strict authentication.
.TP
\fB+\fP[\fBno\fP]\fBtls\-pin\fP=\fIBASE64\fP
Use TLS with the Out\-of\-Band key\-pinned privacy profile (\fI\%RFC 7858#section\-4.2\fP).
Use TLS with a certificate validation. Certification authority certificates
are loaded from the specified PEM file (default is system certificate storage
if no argument is provided).
- Can be specified multiple times. Provide the +tls-hostname option to activate
- strict authentication.
+ Can be specified multiple times. If the +tls-hostname option is not provided,
+ the name of the target server (if specified) is used for strict authentication.
**+**\ [\ **no**\ ]\ **tls-pin**\ =\ *BASE64*
Use TLS with the Out-of-Band key-pinned privacy profile (:rfc:`7858#section-4.2`).
return;
}
}
+
+ // Use server name as hostname for TLS if necessary.
+ if (query->tls.enable && query->tls.hostname == NULL &&
+ (query->tls.system_ca || !EMPTY_LIST(query->tls.ca_files))) {
+ query->tls.hostname = strdup(s->name);
+ }
}
// Use servers from config if any.
} else if (list_size(&conf->servers) > 0) {
return;
}
add_tail(&query->servers, (node_t *)server);
+
+ // Use server name as hostname for TLS if necessary.
+ if (query->tls.enable && query->tls.hostname == NULL &&
+ (query->tls.system_ca || !EMPTY_LIST(query->tls.ca_files))) {
+ query->tls.hostname = strdup(s->name);
+ }
}
// Use system specific.
} else {