Bug 846666 - Print distinct errors when there is no CA cert provided or server cert isn't signed by it
Print distinct errors when there is no CA cert provided or server cert isn't ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: spice-gtk (Show other bugs)
6.4
Unspecified Unspecified
medium Severity medium
: beta
: ---
Assigned To: Marc-Andre Lureau
Desktop QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-08 07:45 EDT by David Jaša
Modified: 2013-07-03 08:01 EDT (History)
7 users (show)

See Also:
Fixed In Version: spice-gtk-0.14-5.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:48:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Jaša 2012-08-08 07:45:28 EDT
Description of problem:
This is and extension/clarification of Bug 834504. The error code:
main-1:0: SSL_connect: error:00000001:lib(0):func(0):reason(1)

is the same for all three scenarios:
1) host subject mismatch ($SUBJ of bug 834504)
2) server certificate not being signed by the provided CA
3) no CA cert provided

This makes debugging of connection failures needlesly difficult, especially when the client is run via RHEV/oVirt Portals.

Version-Release number of selected component (if applicable):
spice-gtk-0.11-11.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Christophe Fergeau 2012-08-10 10:51:49 EDT
Would you happen to have the error messages displayed for case 2) and 3)?
Comment 2 David Jaša 2012-08-10 11:02:05 EDT
Something like:

2) "Spice server certificate is not signed by provided CA certificate"
3) "Secure connection requested but no trust store provided. Please use --spice-ca-file option"
Comment 3 Christophe Fergeau 2012-08-10 11:29:53 EDT
I mean, what happens now? In particular what is the cryptic SSL error?
Comment 4 David Jaša 2012-08-17 06:58:07 EDT
(In reply to comment #3)
> I mean, what happens now? In particular what is the cryptic SSL error?

the one in comment 0, it's the same for all three scenarios mentioned there.
Comment 5 Christophe Fergeau 2012-08-17 07:17:19 EDT
Oh never mind, the warning I was interested in is 

        if (!preverify_ok) {
            spice_warning("openssl verify:num=%d:%s:depth=%d:%s", err,
                          X509_verify_cert_error_string(err), depth, buf);

but it's not printed in all cases :(
Comment 7 David Blechter 2012-10-05 08:26:06 EDT
out of time for 6.4
Comment 8 Marc-Andre Lureau 2012-10-18 09:42:35 EDT
With spice-gtk git, I get the following:

1) ssl_verify.c:484:openssl_verify: ssl: subject 'C=IL,L=Raanana,O=Red Hat,CN=my foo' verification failed

2) ssl_verify.c:428:openssl_verify: openssl verify:num=19:self signed certificate in certificate chain:depth=1:/C=IL/L=Raanana/O=Red Hat/CN=my CA

3) GSpice-WARNING **: loading ca certs from /home/elmarco/.spicec/spice_truststore.pem failed

I guess we could improve the messages a bit, but it seems to be mostly resolved now, agree?
Comment 9 David Jaša 2012-10-18 09:57:57 EDT
(In reply to comment #8)
> I guess we could improve the messages a bit, but it seems to be mostly
> resolved now, agree?

I think so but I'd prefer to keep the bug open till the messages are polished to final state.
Comment 10 Marc-Andre Lureau 2012-10-18 10:12:55 EDT
1) and 3) look fine to me, 2) is the official openssl error: 

19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in certificate chain
    the certificate chain could be built up using the untrusted certificates but the root could not be found locally.

We can also print: "server certificate not being signed by the provided CA" (but I am not sure this is correct)
Comment 11 David Jaša 2012-10-18 10:40:47 EDT
(In reply to comment #10)
> 1) and 3) look fine to me,

agreed.

> 2) is the official openssl error: 
> 
> 19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in
> certificate chain
>     the certificate chain could be built up using the untrusted certificates
> but the root could not be found locally.
> 
> We can also print: "server certificate not being signed by the provided CA"
> (but I am not sure this is correct)

I think this wording is good to make it in.
Comment 12 Marc-Andre Lureau 2012-10-18 15:23:28 EDT
patch sent to ML
Comment 14 Marc-Andre Lureau 2012-12-10 08:06:51 EST
Fixed in spice-gtk-0.14-5.el6
Comment 18 errata-xmlrpc 2013-02-21 03:48:17 EST
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.

http://rhn.redhat.com/errata/RHBA-2013-0343.html

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