'AspNetCore.Proxy reuse connection error message
I use AspNetCore.Proxy to serve request to SSRS (reports service)
Application -> Proxy (inside application) -> SSRS
The application is accessible from an external network. SSRS is accessible only from an internal network (HTTP)
When the application is published on HTTP (80) no issues or errors happen. But, when the application is published on HTTPS (443) - a reuse connection error occurs. SSRS uses its own internal web portal on HTTP (80)
Request could not be proxied. Authentication failed because the connection could not be reused.
So, how to resolve this error?
Application proxy config:
app.UseProxies(proxies =>
{
var url = (string)null;
proxies.Map(
"ReportServer.aspx",
proxy => proxy.UseHttp((context, args) =>
{
url = $"{_reportSettings.SSRSReportServerBaseUrl}/ReportServer/Pages/ReportViewer.aspx" + context.Request.QueryString;
_logger.WriteWithCallerName(LogLevel.Debug, "Startup::Proxy", url);
return url;
},
builder => builder.WithHttpClientName(HTTP_CLIENT_NAME))
);
proxies.Map(
_reportSettings.SSRSProxyRouteBase,
proxy => proxy.UseHttp((context, args) =>
{
url = $"{_reportSettings.SSRSReportServerBaseUrl}/ReportServer/Pages/ReportViewer.aspx" + context.Request.QueryString;
_logger.WriteWithCallerName(LogLevel.Debug, "Startup::Proxy", url);
return url;
},
builder => builder.WithHttpClientName(HTTP_CLIENT_NAME))
);
proxies.Map(
_reportSettings.SSRSProxyRouteBase + "/{**rest}",
proxy => proxy.UseHttp((context, args) =>
{
url = $"{_reportSettings.SSRSReportServerBaseUrl}/ReportServer/" + args["rest"] + context.Request.QueryString;
_logger.WriteWithCallerName(LogLevel.Debug, "Startup::Proxy", url);
return url;
},
builder => builder.WithHttpClientName(HTTP_CLIENT_NAME))
);
});
Parameters from settings:
"SSRSReportServerBaseUrl": "http://172.16.1.40",
"SSRSProxyRouteBase": "ReportServer",
Solution 1:[1]
Finally I had have works solution. Details described at proxy lib github page
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | aik |
