Bug 1208783 - "insecure-skip-tls-verify" in config file prevents following login to other severs with ca cert provided
Summary: "insecure-skip-tls-verify" in config file prevents following login to other s...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 3.x
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: ---
Assignee: David Eads
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-03 07:48 UTC by Ruikai Liu
Modified: 2015-07-07 23:45 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-07 23:45:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ruikai Liu 2015-04-03 07:48:18 UTC
Description of problem:
User should be able to login to different servers with ca certificates either provided or not.

Version-Release number of selected component (if applicable):
openshift v0.4.2-125-gf80ad14-dirty
kubernetes v0.13.1-dev-641-gf057a25

How reproducible:
Always

Steps to Reproduce:
1. Login to server1 with insecure connection:
$ osc login --server=https://<server1>:8443 --insecure-skip-tls-verify
2. Login to server2 with ca certificate provided:
$ osc login --server=https://<server2>:8443 --certificate-authority=/tmp/cert.crt


Actual results:
1. Can login successfully and the context is saved in ~/.config/openshift/.config
2. Cannot login:
F0403 03:18:10.766214    2896 login.go:40] Error: specifying a root certificates file with the insecure flag is not allowed

Expected results:
2. Should be able to login to server2 and save the info in the config file.

Additional info:
After step 1, the file ~/.config/openshfit/.config looks like this:
apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://127.0.0.1:8443
  name: 127-0-0-1-8443
contexts:
- context:
    cluster: 127-0-0-1-8443
    namespace: default
    user: user1
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: user1
  user:
    token: ODE1YmY2NzAtYWNiYi00ZjdhLTk4ZDQtZmJmMmE0OTUwMTBj

Comment 1 Jordan Liggitt 2015-04-03 13:46:49 UTC
When logging into a different/new server, we really shouldn't be copying any of the current context's options

Comment 2 David Eads 2015-04-23 12:42:46 UTC
See https://github.com/openshift/origin/pull/1869

Comment 3 Fabiano Franz 2015-04-23 15:30:02 UTC
Fixed in https://github.com/openshift/origin/pull/1869

Comment 4 Ruikai Liu 2015-04-24 02:05:05 UTC
Verifired with openshift v0.4.4-9-g09f87e4:

$ osc login --server=https://10.14.6.120:8443 --insecure-skip-tls-verify
Username: user1
Authentication required for https://10.14.6.120:8443 (openshift)
Password:
Login successful.
...

$ osc login --server=https://localhost:8443 --certificate-authority=/tmp/cert.crt
Username: user2
Authentication required for https://localhost:8443 (openshift)
Password: 
Login successful.
...


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