Skip to content

Inconsistent header transforms defaults between YARP and Forwarder #1093

@dariusz-wozniak

Description

@dariusz-wozniak

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 working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions