return TRUE;
}
-/*
- * Strip single trailing dot in the hostname,
- * primarily for SNI and http host header.
- */
-static void strip_trailing_dot(struct hostname *host)
-{
- size_t len;
- if(!host || !host->name)
- return;
- len = strlen(host->name);
- if(len && (host->name[len-1] == '.'))
- host->name[len-1] = 0;
-}
-
/*
* Perform any necessary IDN conversion of hostname
*/
*************************************************************/
result = resolve_server(data, conn, async);
- /* Strip trailing dots. resolve_server copied the name. */
- strip_trailing_dot(&conn->host);
-#ifndef CURL_DISABLE_PROXY
- if(conn->bits.httpproxy)
- strip_trailing_dot(&conn->http_proxy.host);
- if(conn->bits.socksproxy)
- strip_trailing_dot(&conn->socks_proxy.host);
-#endif
- if(conn->bits.conn_to_host)
- strip_trailing_dot(&conn->conn_to_host);
-
out:
return result;
}
out there that don't work unless the name is lowercased */
Curl_strntolower(data->state.buffer, hostname, nlen);
data->state.buffer[nlen] = 0;
+ DEBUGASSERT(nlen);
+ DEBUGASSERT(data->state.buffer[nlen-1] != '.');
if(!SSL_set_tlsext_host_name(backend->handle, data->state.buffer))
infof(data, "WARNING: failed to configure server name indication (SNI) "
"TLS extension");
<verify>
<protocol>
GET /%TESTNUMBER HTTP/1.1\r
-Host: example.com:%HTTPPORT\r
+Host: example.com.:%HTTPPORT\r
User-Agent: curl/%VERSION\r
Accept: */*\r
\r