Skip to content

traefik is sending https to am service due to naming of service port #719

Description

@pearj

I'm using 2026.2.1 and out of the box, am doesn't work. After investigations, I noticed that am had some strange errors which indicated it was receiving https request initiation for unencrypted http

java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x050xba0x010x000x050xb60x030x030xafF0xab0xa4P0x9b/^0x11>O0x7f0x9b`0xfcT"k0xa02T0xb80xcd.0xe40x860xb80x17)O0x0c0xe3 ]. HTTP method names must be tokens

Then in the traefik logs I noticed:

ERR 500 Internal Server Error error="tls: first record does not look like a TLS handshake"

I tried using this annotation on the am ingress:

nginx.ingress.kubernetes.io/backend-protocol: HTTP

As it is apparently supported: https://doc.traefik.io/traefik/reference/routing-configuration/kubernetes/ingress-nginx/#opt-nginx-ingress-kubernetes-iobackend-protocol

However that didn't work, the only thing that worked was changing the am service port name from https to something else, e.g. http, bob, etc.

- port: 80
targetPort: https
protocol: TCP
name: https

The target port can still be called https, but the port name can't.

I managed to find this doco on the traefik website: https://doc.traefik.io/traefik/reference/routing-configuration/kubernetes/ingress-nginx/#opt-nginx-ingress-kubernetes-iobackend-protocol

There are 3 ways to configure Traefik to use HTTPS to communicate with pods:

  1. If the service port defined in the ingress spec is 443 (note that you can still use targetPort to use a different port on your pod).
  2. If the service port defined in the ingress spec has a name that starts with https (such as https-api, https-web or just https).
  3. If the service spec includes the annotation traefik.ingress.kubernetes.io/service.serversscheme: https.

Adding traefik.ingress.kubernetes.io/service.serversscheme: http annotation, to the am service also fixes it.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions