http client: use host of http_req for the host name validation
The host name still can be overwritten by http_client_set_tls_hostname(). But
if not set the host name of the HTTP request should be used for the
validation.
@@ -475,6 +475,8 @@ static int conn_connect(struct http_req *req)
if (req->cli->tlshn)
err = tls_peer_set_verify_host(conn->sc,
req->cli->tlshn);
+ else
+ err = tls_peer_set_verify_host(conn->sc, req->host);
if (err)
goto out;
