Bug 1608759

Summary: [e4DnLX6y] router pod cannot be started if enable mutual-tls-auth but not specify mutual-tls-auth-ca
Product: OpenShift Container Platform Reporter: Hongan Li <hongli>
Component: NetworkingAssignee: Ram Ranganathan <ramr>
Networking sub component: router QA Contact: zhaozhanqi <zzhao>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs, dmace, ramr
Version: 3.11.0   
Target Milestone: ---   
Target Release: 3.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-11 07:22:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hongan Li 2018-07-26 09:14:42 UTC
Description of problem:
router pod cannot be started if enable mutual-tls-auth but not specify mutual-tls-auth-ca

Version-Release number of selected component (if applicable):
openshift v3.11.0-0.9.0
kubernetes v1.11.0+d4cacc0

How reproducible:
always

Steps to Reproduce:
1. oc adm router test-router --mutual-tls-auth=required
2. 

Actual results:
error in router pod logs:
[ALERT] 206/080832 (24) : Proxy 'fe_sni': verify is enabled but no CA file specified for bind '127.0.0.1:10444' at [/var/lib/haproxy/conf/haproxy.config:116].
[ALERT] 206/080832 (24) : Proxy 'fe_sni': verify is enabled but no CA file specified for bind '127.0.0.1:10444' at [/var/lib/haproxy/conf/haproxy.config:116].
[ALERT] 206/080832 (24) : Proxy 'fe_no_sni': verify is enabled but no CA file specified for bind '127.0.0.1:10443' at [/var/lib/haproxy/conf/haproxy.config:166].
[ALERT] 206/080832 (24) : Proxy 'fe_no_sni': verify is enabled but no CA file specified for bind '127.0.0.1:10443' at [/var/lib/haproxy/conf/haproxy.config:166].
[ALERT] 206/080832 (24) : Fatal errors found in configuration.


Expected results:
router pod should be running if just enable mutual-tls-auth since "mutual-tls-auth-ca" is optional. 
see command help below:
      --mutual-tls-auth='none': Controls access to the router using mutually agreed upon TLS configuration (example
client certificates). You can choose one of 'required', 'optional', or 'none'. The default is none.
      --mutual-tls-auth-ca='': Optional path to a file containing one or more CA certificates used for mutual TLS
authentication. The CA certificate[s] are used by the router to verify a client's certificate.


Additional info:
the router pod will be running if using below command:
oc adm router test-router --mutual-tls-auth=required --mutual-tls-auth-ca=/root/ca.pem

Comment 1 Ram Ranganathan 2018-07-30 19:37:42 UTC
@hongli good catch - this will need a default value specified. 
The directive seems to be required if verify is specified. 
The router command line option --mutual-tls-auth-ca can still be optional but we will need to change the router template to use a default if the mutual-tls-auth option is set.

Comment 2 Ram Ranganathan 2018-07-31 00:23:57 UTC
Fixed in PR: https://github.com/openshift/origin/pull/20476

Comment 4 Hongan Li 2018-08-23 08:53:32 UTC
verified in atomic-openshift-3.11.0-0.20.0.git.0.d80d8ad.el7 and issue has been fixed.

Comment 6 errata-xmlrpc 2018-10-11 07:22:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2652