Skip to content
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

Reuse connection issue with SSL #91

Closed
aik0n opened this issue Mar 3, 2022 · 8 comments
Closed

Reuse connection issue with SSL #91

aik0n opened this issue Mar 3, 2022 · 8 comments

Comments

@aik0n
Copy link

aik0n commented Mar 3, 2022

Hi, I have an odd problem. Described at
Reuse connection error

After some resolving phase SSRS in this case was published with SSL and an error was changed.
A current one is:

Request could not be proxied.

The SSL connection could not be established, see inner exception.

So, how to resolve this?
How I can log inner exception in this case?
I mean release published application. Is AspNetCore.Proxy lib has any options to use logger?
Should I add custom middleware logger?

@aik0n
Copy link
Author

aik0n commented Mar 4, 2022

Application http - SSRS http - works
Application https - SSRS http - reuse connection issue
Application https - SSRS https (IP address) - certificate issue
Application https - SSRS https (DNS name) - reuse connection issue
Application https - SSRS https (ignore SSL errors) - reuse connection issue

So, how to resolve "reuse connection issue"?

@twitchax
Copy link
Owner

twitchax commented Mar 5, 2022

Hello!

Sorry, I was away on vacation, and I jsut now saw this.

The connection reuse issue probably has to do with Keep-Alive headers. Can you try editing your HttpClient? Try adding...

myHttpClient.DefaultRequestHeaders.ConnectionClose = false;

@aik0n
Copy link
Author

aik0n commented Mar 5, 2022

Hello.
Thanks for help. I added recomended settings and this not resolve the problem.
Also, I added a test proxy map route and have no problem with it.
So, the problem not in proxy lib, maybe network specific thing.

PS I use iframe with post action to application API
This request will be proxied with the can't reuse connection error

PPS HTTP Client configuration:

image

@twitchax
Copy link
Owner

twitchax commented Mar 5, 2022

Ok, that was worth a try. Kind of difficult to serving without a repro on my end. Do you have a similar minimal case that you can share, but using a public endpoint?

@aik0n
Copy link
Author

aik0n commented Mar 7, 2022

It is difficult to coordinate with all interested parties.
Just for tests I added ".WithBeforeSend()" and keep-alive header in it.
It is not resolve the issue but error was changed.
Researching in progress...

image
image

@twitchax
Copy link
Owner

twitchax commented Mar 8, 2022

Interesting: maybe something to do with this?

@aik0n
Copy link
Author

aik0n commented Mar 10, 2022

Okay, finally I have works solution.
No issues in proxy lib. Details matter.
Thank you for this support and advices and great proxy package.

In details:
In my case was helpful add .WithBeforeSend() Later I will provide full config.
The error message "The function requested is not supported" also happens with wrong credentials (or blocked user)
I didn't install any kerberos or NTLM fixes, service packs.
In my case SSRS execution user was blocked after deploy to test environment. Also test env has different domain name. Miscommunications with other team members and human aspect :)

How SSRS was integrated

  1. Application (ASP.NET Core MVC) -> Request to build HTML form with report parameters to SSRS. Parameters depends on user input and selections.
  2. Web URL access to SSRS with HTTP POST (SSRS feature). So SSRS build report by it own and return result with built in controls, etc.
  3. Application has access from external network SSL, VPN. SSRS has access only from internal network
  4. This project proxy lib used to catch special formed URL from HTML form and redirected to internal SSRS
  5. Rendered report displayed in iframe
  6. Config hell ...
  7. Profit :)

HttpClient initialization:

image

Proxy map initialization:

image

@aik0n aik0n closed this as completed Mar 10, 2022
@twitchax
Copy link
Owner

Interesting: glad you got it figured out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants