-
Notifications
You must be signed in to change notification settings - Fork 269
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
TLS cert verification failing when ca.crt only contains root cert and tls.crt contains intermediate and leaf cert #831
Comments
ah, so I noticed you never print the actually error here https://github.com/jcmoraisjr/haproxy-ingress/blob/master/pkg/common/ingress/controller/backend_ssl.go#L45 I changed this to:
Is haproxy not liking only having the root in the ca.crl? |
I suspect the issue is around https://github.com/jcmoraisjr/haproxy-ingress/blob/master/pkg/common/net/ssl/ssl.go#L97 Where the cert validation is happening it looks like pem.Decode is being called once so only a single cert is being extracted. |
Changing https://github.com/jcmoraisjr/haproxy-ingress/blob/master/pkg/common/net/ssl/ssl.go#L138-L143 to if len(ca) > 0 {
bundle := x509.NewCertPool()
bundle.AppendCertsFromPEM(ca)
intBundle := x509.NewCertPool()
intBundle.AppendCertsFromPEM(cert)
opts := x509.VerifyOptions{
Roots: bundle,
Intermediates: intBundle,
} fixed it for me |
Hi, does it work if you concatenate crt(first)+ints+root(last) into the same pem file? |
Fixed in v0.13.2. Closing. |
Description of the problem
When my ingress references TLS secret that has a tls.key, tls.crt and ca.crt, with the ca.crt containing the root cert, and the tls.crt containing the intermediate and leaf cert, the ingress controller says
When I delete the ca.crt from the TLS object and then edit the ingress to force a reconciliation it all loads fine.
Expected behavior
I expect the certs to load.
Environment information
HAProxy Ingress version:
v0.12.6
Command-line options:
Global options:
The text was updated successfully, but these errors were encountered: