I have deployed the ABP framework in a Kubernetes cluster.
Following deployments are present:
- Redis
- MSSql
- AuthServer
- HttpApi.Host
- Nginx ingress / reverse proxy with https termination, no encryption within the cluster.
Hence, the AuthServer, HttpApi.Host are listening on port 80 / http, and the nginx is listening on https. The configuration / Helm values are following:
use-forwarded-headers: "true"
use-proxy-protocol: "true"
use-gzip: "true"
Everything well so far, and after deployment I can enter the Swagger and Authorize:
This can be confirmed when check the AuthServer logs:
[19:12:39 INF] CORS policy execution successful.
[19:12:39 INF] The request URI matched a server endpoint: Token.
[19:12:39 INF] The token request was successfully extracted: {
"grant_type": "authorization_code",
"code": "[redacted]",
"client_id": "foobar_Swagger",
"redirect_uri": "https://api.staging.foobar.io/swagger/oauth2-redirect.html"
}.
[19:12:39 INF] The token request was successfully validated.
However, now I would like to use the Swagger to ensure that the connection towards the endpoints are working correctly, so I try the first GET endpoint:
As you can see, there is a 500 response. Looking the logs at the HttpApi.Host pod:
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
[19:12:52 ERR] Connection id "0HMSQJRK38VSM", Request id "0HMSQJRK38VSM:00000005": An unhandled exception was thrown by the application.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
---> System.Net.Sockets.SocketException (104): Connection reset by peer
--- End of inner exception stack trace ---
So it seems that the HttpApi can not connect to the AuthServer, since it is http according to the stacktrace above "The SSL connection could not be established, see inner exception"
It seems like the HttpApi.Host are connecting via http inside the cluster but the AuthServer does not like it?
Please give me some advices here, thanks in advance.