-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HTTP/3] ServerCertificateCustomValidationCallback causes connection error #55192
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsAdding Code: // HTTP/3
var httpClientHandler = new HttpClientHandler();
httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
using (var client = new HttpClient(httpClientHandler))
{
var request = new HttpRequestMessage(HttpMethod.Get, $"https://127.0.0.1:{http3Port}/");
request.Version = HttpVersion.Version30;
request.VersionPolicy = HttpVersionPolicy.RequestVersionExact;
// Act
var response = await client.SendAsync(request).DefaultTimeout();
// Assert
response.EnsureSuccessStatusCode();
Assert.Equal(HttpVersion.Version30, response.Version);
var responseText = await response.Content.ReadAsStringAsync().DefaultTimeout();
Assert.Equal("hello, world", responseText);
} Error:
|
BTW if you register real callback do you see the correct certificate there? |
Same error, breakpoint in callback never hit: var httpClientHandler = new HttpClientHandler();
httpClientHandler.ServerCertificateCustomValidationCallback = (_, __, ___, ____) =>
{
return true;
}; |
this looks like a problem mapping (Ms)Quic connection back to #55193 may have similar reason. |
Got repro, will continue on Mon. |
Adding
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
causes a connection error on send.Code:
Error:
The text was updated successfully, but these errors were encountered: