Skip to content

crypto/x509: verification fails with "cannot parse dnsName" in intermediate #2149

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

Closed
trunet opened this issue Feb 26, 2018 · 3 comments · Fixed by #2273
Closed

crypto/x509: verification fails with "cannot parse dnsName" in intermediate #2149

trunet opened this issue Feb 26, 2018 · 3 comments · Fixed by #2273
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@trunet
Copy link

trunet commented Feb 26, 2018

Error starting nginx-ingress-controller:

-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:    0.11.0
  Build:      git-9d0ce7c
  Repository: https://github.com/kubernetes/ingress-nginx
-------------------------------------------------------------------------------
E0226 11:51:47.736103       7 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: error reading /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: x509: cannot parse dnsName "Trunet.co AMS Kubernetes Intermediate CA"
I0226 11:51:47.736577       7 main.go:183] Creating API client for https://10.96.0.1:443
I0226 11:51:47.738134       7 main.go:203] trying to discover Kubernetes version
I0226 11:51:48.199656       7 main.go:212] unexpected error discovering Kubernetes version (attempt Get https://10.96.0.1:443/version: x509: certificate signed by unknown authority): 0

My intermediate CA generated by hashicorp vault, contains:

X509v3 Basic Constraints: critical
    CA:TRUE
X509v3 Subject Alternative Name: 
    DNS:Trunet.co AMS Kubernetes Intermediate CA

This will probably be fixed on kubernetes/client-go#371 and golang/go#23995

@aledbf aledbf added the kind/bug Categorizes issue or PR as related to a bug. label Feb 26, 2018
@dkoshkin
Copy link

dkoshkin commented Mar 8, 2018

I'm seeing a related issue in 0.11.0 that worked with the same setup in the previous version.

I0308 16:44:26.897598       5 main.go:212] unexpected error discovering Kubernetes version (attempt Get https://172.20.0.1:443/version: tls: failed to parse certificate from server: x509: cannot parse dnsName "1520520257.kismatic.integration-tests."): 6

The contents of the cert for the api:

        Subject: CN=ip-10-0-3-226.ec2.internal
        X509v3 extensions:
            X509v3 Subject Alternative Name:
                DNS:kubernetes, DNS:kubernetes.default, DNS:kubernetes.default.svc, DNS:kubernetes.default.svc.cluster.local, DNS:ip-10-0-3-226.ec2.internal, DNS:1520520257.kismatic.integration-tests., IP Address:127.0.0.1, IP Address:172.20.0.1, IP Address:184.73.149.217, IP Address:127.0.0.1, IP Address:10.0.3.226

@trunet
Copy link
Author

trunet commented Mar 8, 2018

@dkoshkin this is unrelated, as this specific problem is for CA that doesn't need common, altNames validation.

@dkoshkin
Copy link

dkoshkin commented Mar 8, 2018

Thanks opened #2188 with more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants