-
Notifications
You must be signed in to change notification settings - Fork 889
Closed
Description
YARP Direct Proxy for one of the endpoint screams with the following error:
The SSL connection could not be established, see inner exception
Inner exception says:
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
In the current, non-YARP proxy solution, the problem is solved (or rather, by-passed) by setting the ServerCertificateCustomValidationCallback
flag:
public class IgnoreSslHandler : HttpClientHandler
{
public IgnoreSslHandler()
{
if (Environment.IsDevelopment())
{
ServerCertificateCustomValidationCallback = DangerousAcceptAnyServerCertificateValidator;
}
}
}
But, HttpMessageInvoker
with the HttpClientHandler
that has the ServerCertificateCustomValidationCallback
flag set to either true or to DangerousAcceptAnyServerCertificateValidator
doesn't seem to be used in the YARP.
Code snippet that is used for proxy context:
await httpProxy.ProxyAsync(httpContext, "https://url", httpClient, requestOptions, transformer);
Any idea how to solve that?
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't workingSomething isn't working