Skip to content

Commit f34e99f

Browse files
author
ladeak
committed
Set SslOptions.TargetHost to "localhost" in client
Added explicit assignment of SslOptions.TargetHost to "localhost" in the CreateClient method to ensure correct SSL target host during HTTP requests.
1 parent f8139e9 commit f34e99f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎tests/CHttpServer.Tests/Http3/Http3IntegrationTests.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ protected HttpClient CreateClient()
1818
{
1919
var handler = new SocketsHttpHandler();
2020
handler.SslOptions.RemoteCertificateValidationCallback = (message, certificate, chain, sslPolicyErrors) => certificate?.Issuer == "CN=localhost";
21+
handler.SslOptions.TargetHost = "localhost";
2122
return new HttpClient(handler);
2223
}
2324

0 commit comments

Comments
 (0)