https fails, http works what is the reason? #1827
-
Why can't I use the browser to access an API behind a remote proxy when the connection between the proxy and the API is over https? or in other words: Yarp acts as a reverse proxy The client is a Blazor program and using an HttpClient the client can successfully access the api through the proxy. If I now access the API with the browser (Edge) via the proxy, I get an error (see below). This way only works if I switch the connection between the proxy and the api from https to http. (Food works, drinks not) The configuration {
"Clusters": {
"food-cluster": {
"Destinations": {
"destination1": {
"Address": "http://localhost:5010"
}
}
},
"drink-cluster": {
"Destinations": {
"destination1": {
"Address": "https://localhost:5021"
}
}
}
}
} The Error:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
I fixed your question formatting - its easier to read if you use ``` blocks as you can specify the language for the block and get colorization. How are the services implemented? What happens if you access them directly with cURL or similar? |
Beta Was this translation helpful? Give feedback.
I fixed your question formatting - its easier to read if you use ``` blocks as you can specify the language for the block and get colorization.
How are the services implemented? What happens if you access them directly with cURL or similar?
It seems that YARP is having an issue with Http/2. H2 typically requires TLS, so changing to http://, will use 1.1 rather H2, so that may be your problem.
You can configure the http version that YARP will use as part of the destination configuration: https://microsoft.github.io/reverse-proxy/articles/http-client-config.html#httprequest