http-add-on
http-add-on copied to clipboard
TLS requests are sent over HTTP instead of HTTPS
Report
I've setup the http-add-on with TLS enabled. The certificates are read from the add-on and TLS verification works correctly. My issues is when I send an https
request to my ingress controller, the interceptor instead of sending the request to my service via https
it switches to http
.
According to this, shouldn't it work via https
if TLS is enabled?
https://github.com/kedacore/http-add-on/blob/0793ecec5a9f65d5843c36a544525987efc17521/interceptor/middleware/routing.go#L67-L83
I've tried sending the same request the add-on is attempting but with https
and it works as expected.
Expected Behavior
Interceptor should send requests via https
Actual Behavior
Interceptor sends requests via http
Steps to Reproduce the Problem
- Setup keda with http-add-on like usual
- Enable TLS
- Add TLS certificates on both ingress controller and http-add-on
- Send a request to the ingress controller via
https
Logs from KEDA HTTP operator
2024-05-14T08:00:34Z ERROR LoggingMiddleware.RoutingMiddleware.CountingMiddleware.UpstreamHandler.StaticHandler Bad Gateway {"routingKey": "//uat.mydomain.com/devops-274/", "namespacedName": {"name":"site-devops-274","namespace":"core-uat-branches"}, "stream": "http://site-devops-274.core-uat-branches:443/devops-274", "error": "read tcp 10.121.0.23:46932->10.4.235.37:443: read: connection reset by peer"}
github.com/kedacore/http-add-on/interceptor/handler.(*Static).ServeHTTP
github.com/kedacore/http-add-on/interceptor/handler/static.go:36
github.com/kedacore/http-add-on/interceptor/handler.(*Upstream).ServeHTTP.func2
github.com/kedacore/http-add-on/interceptor/handler/upstream.go:54
net/http/httputil.(*ReverseProxy).ServeHTTP
net/http/httputil/reverseproxy.go:472
github.com/kedacore/http-add-on/interceptor/handler.(*Upstream).ServeHTTP
github.com/kedacore/http-add-on/interceptor/handler/upstream.go:57
main.runProxyServer.newForwardingHandler.func2
github.com/kedacore/http-add-on/interceptor/proxy_handlers.go:87
net/http.HandlerFunc.ServeHTTP
net/http/server.go:2166
github.com/kedacore/http-add-on/interceptor/middleware.(*Counting).ServeHTTP
github.com/kedacore/http-add-on/interceptor/middleware/counting.go:35
github.com/kedacore/http-add-on/interceptor/middleware.(*Routing).ServeHTTP
github.com/kedacore/http-add-on/interceptor/middleware/routing.go:64
github.com/kedacore/http-add-on/interceptor/middleware.(*Logging).ServeHTTP
github.com/kedacore/http-add-on/interceptor/middleware/logging.go:42
github.com/kedacore/http-add-on/interceptor/middleware.(*Metrics).ServeHTTP
github.com/kedacore/http-add-on/interceptor/middleware/metrics.go:24
net/http.serverHandler.ServeHTTP
net/http/server.go:3137
net/http.(*conn).serve
net/http/server.go:2039
HTTP Add-on Version
0.8.0
Kubernetes Version
1.28
Platform
Microsoft Azure
Anything else?
No response