First of, thanks for building a great open source product which has great community support.
I'm trying to get Vault to work with the Kubernetes Auth method in OpenShift. I'm following this guide published on the OpenShift blog which utilizes this code, but I'm running into a problem verifying that the authentication works in step B-11.
When I execute the "vault write -tls-skip-verify auth/kubernetes/login role=spring-native-example jwt=$default_account_token" command, I get certificate untrusted errors (Post https://kubernetes.openshift.ott1-eng.internal/apis/authentication.k8s.io/v1/tokenreviews: x509: certificate signed by unknown authority). I've tried several of the internally resolvable domains (kubernetes.default.svc etc), all resulting in the same errors. However, I have verified the certificate chain (by download the cert of the website via the container and loading up the CA from step B-4) with OpenSSL, even just by looking at the cert I can see the signer is the CA that is being loaded up by the plugin.
I've also tried redeploying our OpenShift cluster several times with different internal configurations, to no avail, and tried it on several production clusters. All return with the same error. But I won't wade too much into the OpenShift territory here.
So for the actual questions;
* The only possibly strange thing that I can see it that there are no Subject Alt Names on the cert. Is it possible that golang doesn't see a cert as valid if there aren't any SANs?
* Has anybody gotten this to work with either Kubernetes or OpenShift, or see any glaring errors in the linked blog post?
This was my suspicion as well, since it's not external but internal communication between vault and k8s master API. When I was investigating this issue, I started looking at the vault auth plugin source code and found out that it actually loads up the CA cert that has to be configured as a PEM in the vault config path. Regardless, I've also tried loading up the CA cert (including mounting the whole folder etc) into usr/local/share/ca-certificate and calling update-ca-certificate on startup, since the container supports this. Also, no joy :( Maybe you know of an alternative (and/or better) way of loading up the CA certificates into the vault container?Maybe this is also why it seems as such a weird problem to me; I'd expect the internal communication between a container and "hosted" k8s APIs to "just work".

Error writing data to auth/kubernetes/login: Error making API request.
URL: PUT https://vault-aasvault.openshift.ott1-eng.internal/v1/auth/kubernetes/login
Code: 500. Errors:
* Post https://10.124.100.150/apis/authentication.k8s.io/v1/tokenreviews: x509: cannot validate certificate for 10.124.100.150 because it doesn't contain any IP SANs

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vault" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vault-tool/h0c9nNEhmrM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vault-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/ca9eaec1-0439-4f69-a031-0046bd507eaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/CAOFC%2BHp2MAQJ91gN7RXPiY7VaO%2BCaEVc-q3r8t264bV5BtRg6Q%40mail.gmail.com.
CONNECTED(00000003)
depth=1 CN = openshift-signer@1516754909
verify error:num=19:self signed certificate in certificate chain
verify return:0
---
Certificate chain
0 s:/CN=10.124.100.150
i:/CN=openshift-signer@1516754909
1 s:/CN=openshift-signer@1516754909
i:/CN=openshift-signer@1516754909
---
Server certificate
-----BEGIN CERTIFICATE-----
MIID/TCCAuWgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBtvcGVu
c2hpZnQtc2lnbmVyQDE1MTY3NTQ5MDkwHhcNMTgwMTI0MDA0ODMxWhcNMjAwMTI0
MDA0ODMyWjAZMRcwFQYDVQQDEw4xMC4xMjQuMTAwLjE1MDCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBANzHtx6ef9h+JQpWyQ7F99/68tlcHu64drON3JFb
fYm2z2ZaE9lL1PXf+XBvHVnLq04NYZz7hF8N9Y5RlzZ25vOnZVSmOrNDojtlMLFg
RgUhhrpHv7myuu6H9YEbS9hAtSj+7gg3pHx0W44sOcmW1sbs/z2OzUnNrDL1ZZea
SsSLrbNEMUjcjqoEuW1+zypBfmGSd6T9TQiaeIe+crmrMu2SrclqKi2WRf+p8urT
tSBdikUgptLa2jsyn4ThAwzQsdIcK2QGP4DbsSjebjkxM/ArJ1peD6LZBrrgWmB+
wPgQ6mCWdT/pjjoLh5PEteGuZAytMkx/CuKbnJBCUMgiTuMCAwEAAaOCAUEwggE9
MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8E
AjAAMIIBBgYDVR0RBIH+MIH7ggprdWJlcm5ldGVzghJrdWJlcm5ldGVzLmRlZmF1
bHSCFmt1YmVybmV0ZXMuZGVmYXVsdC5zdmOCJGt1YmVybmV0ZXMuZGVmYXVsdC5z
dmMuY2x1c3Rlci5sb2NhbIIJb3BlbnNoaWZ0ghFvcGVuc2hpZnQuZGVmYXVsdIIV
b3BlbnNoaWZ0LmRlZmF1bHQuc3ZjgiNvcGVuc2hpZnQuZGVmYXVsdC5zdmMuY2x1
c3Rlci5sb2NhbIIZb3NvbWQwMS5vdHQxLWVuZy5pbnRlcm5hbIIOMTAuMTI0LjEw
MC4xNTCCCjE3Mi4zMC4wLjGHBAp8ZJaHBKweAAEwDQYJKoZIhvcNAQELBQADggEB
AATo42EkrpHqT6zFS7t5Hv+PsjFia3DpwrEJwuB7pg8o26TJc9/IYPPw+sj9fX82
23ZZ+fXqimzc/HZ83Cq7gTj61HYcZ9WszNdtZ2ZWeb5Q7oHREpiNjyk9DvZgF2Qx
TYtOFtvG7HTT6WMBdi216hrDwRVt7jsryt0buTpGdFzc8AUGBlpAT8LZ6uzIrDO3
+ycou3Y7DoLOie7zKWFFoNQQkV1U686AhHW9Wz/2UKDl+QFsWvyPicUHUZjvz+nP
lII5K56b+Oy/I0MS0bMPMGzrIPonLVGhAJ7JSctomkGIOcbiNaOt3z3eAV/TNVnj
iqAWy822qS2oQh+NJoDr3Tk=
-----END CERTIFICATE-----
subject=/CN=10.124.100.150
issuer=/CN=openshift-signer@1516754909
---
Acceptable client certificate CA names
/CN=openshift-signer@1516754909
/CN=openshift-signer@1516755820
---
SSL handshake has read 2496 bytes and written 427 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES128-GCM-SHA256
Session-ID: A83B13112BF3165B4841D0EB448F23BE58DCE5D181656ED1F3B377163F9E147B
Session-ID-ctx:
Master-Key: 10796D42ACF2D7228EF5E47C6E84A4AD6EFF46E7780D1A33E1CBB526B1870A89960ABB35C8A836D09D019CA5CE3112E8
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket:
0000 - f2 99 e4 3f 32 17 15 3d-03 b7 f6 aa b0 4a 6d cd ...?2..=.....Jm.
0010 - d3 79 c3 0e 7b 77 6d 7a-ec eb c9 97 f5 7f f9 ae .y..{wmz........
0020 - a4 8c 7e 9a 4b 1d 57 0a-83 18 6f 7d 36 05 fc 86 ..~.K.W...o}6...
0030 - d9 89 43 ba 23 35 55 84-9c 30 39 e4 16 85 bb 80 ..C.#5U..09.....
0040 - e5 ae 44 c5 b6 bb 00 64-8e 54 9a 4f b4 27 b0 eb ..D....d.T.O.'..
0050 - 38 44 1f e5 12 1e 60 13-99 c7 1a b3 02 9f 65 77 8D....`.......ew
0060 - d4 13 05 77 c3 77 e6 23-3e d8 e5 bc f6 f7 75 4f ...w.w.#>.....uO
0070 - 88 26 12 fb 3a 46 8e 9a- .&..:F..
Start Time: 1522857198
Timeout : 300 (sec)
Verify return code: 19 (self signed certificate in certificate chain)
---
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/CAORe8GGnDR5MWFV2tqf%2B-CXx1US%3Du5z4ybBGzchGe9KdS%2Ba50w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/CAOFC%2BHo0MJtfemLY8cAFkMkDFhT1owXq-hK%2BrJ30suzW3dJkug%40mail.gmail.com.
You got this from openssl s_client against https://10.124.100.150/apis/authentication.k8s.io/v1/tokenreviews ?
What version of Vault? The certificate is a bit wonky -- it has IP addresses in as DNS SANs in addition to IP SANs so I wonder if it's tripping up validation logic.Generally speaking with a valid cert it there should be no issues w.r.t. Go.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/CAORe8GFTY%2BTs_MdKy1J%2Bc43LV0%2BW-AeHGQa7AOoJhW5meq3Bjg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/CAOFC%2BHqJXy0V-3FA4RX5pp%2B5DC8MBdz4oWaJDiM-1DiPhzhWUw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/CAORe8GGBF_tvt4CRm_YEhbsiCrtB%2Bg8yvO%3DhaSc793Aq-X3FsA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/CAOFC%2BHqFKjy1z4Uy2oRz1LggM7NN80YyFp08_Tu81Qeu4nzpjQ%40mail.gmail.com.