-
-
Notifications
You must be signed in to change notification settings - Fork 83
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/2 + SSL to HTTP proxying #78
Comments
Hello! Glad to hear that this library is working out well for you. I think the best method would be to add to the options, and strip the headers. Sort of like this. proxies.Map(proxyEntry.Key,
proxy => proxy.UseHttp(
(_, args) => { /* your normal endpoint computer logic */ },
options => options.WithAfterReceive((context, response) => response.Headers.Clear())
)); So, the first thing to note here is that Basically, the Let me know if this works. If not, we'll figure out something. :) |
Thanks for the super quick response! I'll give it a go later tonight. |
Yes, and that gives me a better idea. ASP.NET might do the magic for us automatically. It's not that HTTP/2 doesn't have headers: it's that HTTP/2 doesn't have plaintext headers. Let me see if I can automatically detect the version override the response. |
Thanks! I can confirm that clearing the headers solves the issue, but I would prefer a better solution. Let me know if you want me to test a pre-release NuGet version or something of that sort... |
Hi @HarelM, yeah, I agree. The problem is that stripping the headers is not technically the right solution. HTTP/2 allows for headers, but they are part of the body, I think. I need to do more research to discover the exact correct response. |
I tried looking at the code in this repo tonight. AspNetCore.Proxy/src/Core/Extensions/Http.cs Line 122 in 274bd4c
Interestingly I don't see the version being copied (which is expected), so I'm not sure why the headers are not "converted" properly as the response is updated in the original http context... I looked at this SO question: https://stackoverflow.com/questions/53764083/use-http-2-with-httpclient-in-net I'm probably still missing something... The docs on this are so limited I'm having a hard time finding anything related to this in google... |
Hello. I am going to describe my problem. Maybe, you can help me to resolve it the best way. I have the web-site which I reach throught the proxy. During the execuption of the request I get the exceptoin with the message: "The SSL connection could not be established, see inner exception. (the message of the inner exceptoin is The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch)". When proxy tries to reach this site it gets redirect to another site with https-schema. However, http-header with name "Host" does not change its value. As a result, RemoteCertificateNameMismatch happend. I remove this header and it works fine.
If you want, I may send the url which exception occured in private message. I am not sure that I may publish this here. It is great pleasure to get your opinion about this situation. |
@mpashkov, this sounds like something that is unique to the server. You may need to set the |
Just a note, we have moved from using this library to use Nginx and this solved our issue related to http2. I guess it has to do with the implementation of Nginx vs .net core. Thanks for all the hard work invested in this project! It served us well. 🙏 |
Hi,
First and foremost, thanks a lot for this great library!
I've been using this in production for a while now and it is working great!
We have recently did a migration from a Windows server to a linux server.
The migration was also out of IIS and into kestrel as the server in the front.
I'm guessing that this change allowed browsers to start communicating though the HTTP/2 protocol.
My question is how does this package support this.
The question comes from a problem we just observer.
The problem is as follows:
Chrome and FireFox are OK with this, but curl and safari are not and we see issues with our iOS users.
Are you guys familiar with this? Is this a know limitation? Do I need to configure something to make this work?
My proxy code can be found here:
https://github.com/IsraelHikingMap/Site/blob/508259dd1c16466f9b00711581ab48da8ecbd431/IsraelHiking.Web/Startup.cs#L174
The text was updated successfully, but these errors were encountered: