Bug 1655683

Summary: A proper and correct error message should be displayed during "Certificate Chain Test"
Product: Red Hat Hybrid Cloud Console (console.redhat.com) Reporter: Ashish Humbe <ahumbe>
Component: ClientAssignee: jcrafts
Status: CLOSED CURRENTRELEASE QA Contact: Pavol Kotvan <pakotvan>
Severity: medium Docs Contact: Kevin Blake <kblake>
Priority: medium    
Version: unspecifiedCC: fstavela, jnewton, klape, lphiri
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-14 18:09:14 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 Ashish Humbe 2018-12-03 17:01:48 UTC
Description of problem:

When there is authenticated proxy used on insights client, the test-connection throws with incorrect error 

# redhat-access-insights --test-connection --verbose
2018-12-02 07:29:14,228    DEBUG insights.client.client Logging initialized
2018-12-02 07:29:14,228    DEBUG root Loaded initial egg: /var/lib/insights/last_stable.egg/insights
2018-12-02 07:29:14,228    DEBUG insights.client /usr/bin/gpg --verify --keyring /etc/insights-client/redhattools.pub.gpg /var/lib/insights/last_stable.egg.asc /var/lib/insights/last_stable.egg
2018-12-02 07:29:14,237    DEBUG insights.client GPG return code: 0
2018-12-02 07:29:14,551    DEBUG insights.client.client Logging initialized
2018-12-02 07:29:14,551     INFO insights.client.phase.v1 Running Connection Tests...
2018-12-02 07:29:14,551    DEBUG insights.client.connection NO PROXY: None
2018-12-02 07:29:14,551    DEBUG insights.client.connection CONF Proxy: http://proxy.example.com:1234
2018-12-02 07:29:14,557    ERROR insights.client.connection Connection test config:
2018-12-02 07:29:14,557    DEBUG insights.client.connection Proxy config: {'https': 'http://proxy.example.com:1234'}
2018-12-02 07:29:14,557    DEBUG insights.client.connection Certificate Verification: /etc/insights-client/cert-api.access.redhat.com.pem
2018-12-02 07:29:14,557     INFO insights.client.connection === Begin Certificate Chain Test ===
2018-12-02 07:29:14,563    ERROR insights.client.connection Failed to connect to https://cert-api.access.redhat.com/r/insights. Invalid hostname.
2018-12-02 07:29:14,563     INFO insights.client.connection === End Certificate Chain Test: FAILURE ===


Here we can see that the error message is:      Failed to connect to https://cert-api.access.redhat.com/r/insights. Invalid hostname.

The proper error message should be thrown on the console. 


How reproducible:
When there is an issue with the internet connection. 

Steps to Reproduce:
1. Setup Insights client to connect via authenticated HTTP Proxy
2. Try to run insights-client --test-connection 

Actual results:

"Begin Certificate Chain Test" fails with below error, the error message is incorrect. 

Failed to connect to https://cert-api.access.redhat.com/r/insights. Invalid hostname.

Expected results:
A proper and correct error message should be displayed.

Additional info:

Comment 1 jcrafts 2019-06-14 18:09:14 UTC
This test was removed from the connection tests.