Bug 1117466 - "rhc server use" incorrectly shares configs between servers
Summary: "rhc server use" incorrectly shares configs between servers
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-08 18:42 UTC by Brenton Leanhardt
Modified: 2015-05-15 02:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-10 00:48:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test CA that will reproduce the bug (1.45 KB, application/x-x509-ca-cert)
2014-07-08 18:42 UTC, Brenton Leanhardt
no flags Details

Description Brenton Leanhardt 2014-07-08 18:42:49 UTC
Created attachment 916527 [details]
Test CA that will reproduce the bug

Description of problem:

Given two servers A and B configured using rhc, if A uses a custom CA and B does not use the same CA then switching from A to B will fail.

Here's how to reproduce using the attahced test CA:

~/.openshift/express.conf
libra_server=broker.example.com

---
- server:
    hostname: openshift.redhat.com
    use_authorization_tokens: true
    nickname: online
    insecure: false
    login: XXXXXX
- server:
    hostname: broker.example.com
    use_authorization_tokens: true
    nickname: ose
    ssl_ca_file: [see attached]
    insecure: false
    login: XXXXXXX

$ rhc server use online => "The server's certificate could not be verified..."

Version-Release number of selected component (if applicable):
1.26.9

Additional info:

This appears to be due to the following logic:

https://github.com/openshift/rhc/blob/master/lib/rhc/commands/server.rb#L210

'options' behaves like a global variable and is set to broker.example.com's setting when rhc starts up.  When the use command is run it then triggers this logic but the CA setting is not removed when the new setting is nil.

Comment 1 openshift-github-bot 2014-07-09 00:54:43 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/0676da829522112196044a670210998805990c9b
Bug 1117466 - should not reuse SSL certs from different server configs

Comment 2 XiuJuan Wang 2014-07-09 05:15:43 UTC
Verified on the lastest rhc build from devenv_4950

Could switch servers when they have different CA files.

---
- server:
    hostname: openshift.redhat.com
    nickname: online
    login: XXXXXXXXX
    use_authorization_tokens: true
    insecure: false
- server:
    hostname: int.openshift.redhat.com
    nickname: int
    login: XXXXXXXX
    use_authorization_tokens: true
    insecure: true
    ssl_version: SSLv3
    ssl_client_cert_file: ./cert/server.crt
    ssl_ca_file: ./root-ca.crt.pem

Mark bug as verified.

Comment 3 XiuJuan Wang 2014-07-14 06:37:09 UTC
rhc-1.28.0 build from devenv_4962

Given two servers A and B configured using rhc, if A uses timeout parameter and B does not use the same parameter.Then switching from A to B, B will use A server's timeout value.

step 1: Server list
Server 'online' (in use)
------------------------
  Hostname:        openshift.redhat.com
  Login:           XXXXXXXXXXX
  Use Auth Tokens: true
  Insecure:        false
  Timeout:         22

Server 'stg'
------------
  Hostname:        stg.openshift.redhat.com
  Login:           XXXXXXXXXX
  Use Auth Tokens: true
  Insecure:        true

2.Switch online to stg

3.Server list, stg shares online's timeout parameter.
Server 'online'
---------------
  Hostname:        openshift.redhat.com
  Login:           xiuwang+6
  Use Auth Tokens: true
  Insecure:        false
  Timeout:         22

Server 'stg' (in use)
---------------------
  Hostname:        stg.openshift.redhat.com
  Login:           xiuwang
  Use Auth Tokens: true
  Insecure:        true
  Timeout:         22

Comment 4 Fabiano Franz 2014-07-14 14:15:35 UTC
Timeout issue fixed in https://github.com/openshift/rhc/pull/625

Comment 5 openshift-github-bot 2014-07-14 15:55:02 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/96a22b95112402476c401568cc1ba796f39ffe2e
Bug 1117466 - fixes overriding timeout config

Comment 6 XiuJuan Wang 2014-07-15 02:47:40 UTC
rhc build from devenv_4967

Can't reproduce this issue of comment 3.

Move bug to verified. Thanks!


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