Bug 692118

Summary: Misleading error message when using self-signed SSL certificate for repository
Product: Red Hat Enterprise Linux 6 Reporter: Alexander Todorov <atodorov>
Component: yumAssignee: Nils Philippsen <nphilipp>
Status: CLOSED NOTABUG QA Contact: Karel Srot <ksrot>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: akozumpl, james.antill, jzeleny, kdudka, kengert, ksrot, nphilipp, ovasik, pknirsch, prc, rcritten, rwilliam, thoger
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 678580
: 738367 (view as bug list) Environment:
Last Closed: 2013-04-09 21:13:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 678580, 738367    
Bug Blocks: 670159, 705163    
Attachments:
Description Flags
1st error message
none
2nd error message
none
tarball with logs from stage2 none

Description Alexander Todorov 2011-03-30 13:15:09 UTC
+++ This bug was initially created as a clone of Bug #678580 +++

Created attachment 479513 [details]
anaconda.log

Description of problem:

When using https with self-signed certificate one needs to use the --noverifyssl option to the url and repo commands in kickstart. If the user specifies --noverifyssl only for the url command the listed repository is silently accepted although its certificate can't be verified.

Version-Release number of selected component (if applicable):
anaconda-13.21.97-1.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Configure HTTPS with self-signed certificate and put into your ks.cfg:

url --url https://example.com/rhel --noverifyssl
repo --name=LoadBalancer --baseurl=https://example.com/rhel/LoadBalancer/

%packages --ignoremissing
@Core
piranha
%end

Here the repository is loopback mounted DVD under /var/www/html/rhel.

2. Complete the install and reboot.
3.
  
Actual results:
The repository is silently accepted and the piranha package is installed. 

Expected results:
The repository is ignored because its certificate can't be verified (either with an error dialog or silently) and the piranha package is not installed (because of --ignoremissing).

Additional info:
In anaconda.log we find:

14:01:25,571 INFO    : anaconda called with cmdline = ['/usr/bin/anaconda', '--stage2', 'https://dell-per810-01.lab.bos.redhat.com/rhel/images/install.img', '--dlabel', '--kickstart', '/tmp/ks.cfg', '--graphical', '--selinux', '--lang', 'en_US.UTF-8', '--keymap', 'us', '--repo', 'https://dell-per810-01.lab.bos.redhat.com/rhel', '--noverifyssl']

Which sounds like --noverifyssl for url acts like a global parameter.

Comment 1 Alexander Todorov 2011-03-30 13:17:16 UTC
I believe the original bug against curl has been fixed. With anaconda 13.21.107 the repo wasn't silently accepted but instead a big error message telling me that repo metadata can't be read was shown. 

Is it possible to show error message telling the user that the SSL certificate of the repository is not trusted instead of showing a generic read error?

Comment 3 Kamil Dudka 2011-03-30 17:10:28 UTC
Big error message?  What exactly?

Did you try libcurl verbose mode?

Comment 4 Kamil Dudka 2011-03-30 17:13:52 UTC
I've just realized this bug is against Anaconda.  Feel free to ignore my questions if this is not about libcurl...

Comment 6 David Cantrell 2011-05-26 18:54:48 UTC
atodorov,

Can you see if RHEL 6.1 GA is still showing this problem?

Comment 7 Alexander Todorov 2011-05-27 11:03:17 UTC
Hi David,
6.1 GA no longer silently accepts the repository but issues errors which I'm not sure a bug or not. 

Anaconda says unable to read metadata for the repository and when you select to "Continue" it doesn't simply ignore it but shows another error message and the user has to exit the installer. I'm attaching screenshots and a tarball of logs from stage2.

Comment 8 Alexander Todorov 2011-05-27 11:03:48 UTC
Created attachment 501281 [details]
1st error message

Comment 9 Alexander Todorov 2011-05-27 11:03:59 UTC
Created attachment 501282 [details]
2nd error message

Comment 10 Alexander Todorov 2011-05-27 11:04:19 UTC
Created attachment 501283 [details]
tarball with logs from stage2

Comment 14 Ales Kozumplik 2011-06-27 13:12:51 UTC
The exception is raised by yum with the explanatory error message:

"Cannot retrieve repository metadata (repomd.xml) for repository: %s. Please verify its path and try again"

Besides this no indication is given on why exactly the access has failed, therefore Anaconda can not do any better than displaying a generic message that access to the repo has failed and redisplaying whatever yum gave us. Reassigning to yum, yum maintainers please provide a flag in the exception or similar that will allow us to deduce that the call failed because an ssl connection with unverifiable peer certificate has been attempted.

Comment 25 Alexander Todorov 2011-09-15 08:10:38 UTC
FYI Fedora bugs:
738566 - python-urlgrabber
738367 - yum
738568 - anaconda

Comment 30 James Antill 2013-04-09 21:13:01 UTC
 Given that this likely requires backports for libcurl/pycurl and urlgrabber, and maybe yum. How late it is in RHEL-6, and how little it should happen in real life, I'm going to close this. It should be fixed in RHEL-7.