Bug 1707339 - oc tool does not trust the server's cert if CA cert contains Trust Settings
Summary: oc tool does not trust the server's cert if CA cert contains Trust Settings
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: apiserver-auth
Version: 3.11.0
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
: 3.11.z
Assignee: Erica von Buelow
QA Contact: Chuan Yu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-07 10:38 UTC by Dmitry Gadeev
Modified: 2019-05-30 15:12 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-30 15:12:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github golang go issues 31881 0 None open crypto/tls: incompatibility with Trust Settings in CA certificate 2020-04-29 10:16:03 UTC

Description Dmitry Gadeev 2019-05-07 10:38:51 UTC
Description of problem:
Unable to to log into a OpenShift 3.11 cluster with custom certificates configured (issued by intermediate CA, while root CA cert is trusted by a client's computer) because the oc tool does not trust server's certificate due to presence of Trust Settings (https://www.openssl.org/docs/manmaster/man1/x509.html#TRUST_SETTINGS) in the CA cert.

The MS AD-based CAs DO have such field in their certs.



Version-Release number of selected component (if applicable):
v3.11.98


How reproducible:
Use custom certificates for publicUrl issued by CA with Trust Settings in the their certificate.


Actual results:
# Try to login to the cluster
uzer@mgmt-host:~$ oc login https://os.corp.org:8443 --token=XXX --certificate-authority=${HOME}/git/openshift-oscp-config/corpRootCA.pem
The server uses a certificate signed by an unknown authority.

# Strip Trust Settings from CA cert
openssl x509 -in ${HOME}/git/openshift-oscp-config/corpRootCA.pem -out ${HOME}/git/openshift-oscp-config/corpRootCA.clean.pem

# Try to login to the cluster again
uzer@mgmt-host:~$ oc login https://os.corp.org:8443 --token=XXX --certificate-authority=${HOME}/git/openshift-oscp-config/corpRootCA.clean.pem

Authentication required for https://os.corp.org:8443 (openshift)
Username:


Expected results:
Successful login request.


Additional info:
The problem is not openshift specific but rather a golang-based wide one and connected with crypto/tls library. Additional info is available at https://github.com/golang/go/issues/31881

Comment 2 Erica von Buelow 2019-05-30 15:12:22 UTC
We'll follow the issue upstream in golang. When/if they address it we can look into re-compiling with the fix.


Note You need to log in before you can comment on or make changes to this bug.