Bug 454151 - CA certificate "missing" for launchpad, bzr fails
Summary: CA certificate "missing" for launchpad, bzr fails
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: curl
Version: 9
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 501138
TreeView+ depends on / blocked
 
Reported: 2008-07-05 14:20 UTC by Gene Czarcinski
Modified: 2014-06-10 04:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-14 15:39:33 UTC
Type: ---
Embargoed:
gczarcinski: needinfo-


Attachments (Terms of Use)
"works" certificate packet (38.17 KB, text/plain)
2008-07-09 13:30 UTC, Gene Czarcinski
no flags Details
"does not work" certificate packet (38.17 KB, text/plain)
2008-07-09 13:32 UTC, Gene Czarcinski
no flags Details

Description Gene Czarcinski 2008-07-05 14:20:33 UTC
Refs:
https://bugs.launchpad.net/bugs/245634
https://bugzilla.redhat.com/show_bug.cgi?id=454126
https://bugzilla.redhat.com/show_bug.cgi?id=454129

Description of problem:

The basic problem is that "bzr launchpad-login xxxx" fails because libcurl found
something wrong with the CA cert (or so the message says).

I have been tracking this problem down through bzr, then python-pycurl,
sidetracked to openssl because it looked like the CA cert was missing from
ca-bundle.crt, and finally to curl/libcurl.

I do not know if anyone has bzr launchpad-login working on Fedora 9 but I do not
which makes all my work with using bzr and launchpad at risk.  I do have a
workaround which de-installs python-pycurl which causes bzr to work with no cert
verification.

environment: x86_64, Fedora 9 with updates ~ 7/4/08.
----------------------------------------------------
Here are the last tests I ran:

First, I installed "curl" to have a nice command line
interface.

1. run: curl --cacert /etc/pki/tls/certs/ca-bundle.crt https://www.redhat.com
result: html

2. run: curl --cacert /etc/pki/tls/certs/ca-bundle.crt https://launchpad.net
result: curl: (60) Peer certificate cannot be authenticated ...
-----------------------------------------------------
get new cacert.pem from http://curl.haxx.se/docs/caextract.html
[curl website] ... I was assuming that a cert was missing
-----------------------------------------------------
3. run: curl --cacert ./cacert https://www.redhat.com
result: html

4. run: curl --cacert ./cacert https://launchpad.net
result: html ... looking good!
-----------------------------------------------------
This proves something but I am not sure what because if I copy the new
cacert.pem into /etc/pki/tls/certs/ and try to use it from there, redhat works
but launchpad does not.

OK, one more test:  copy /etc/pki/tls/certs/ca-bundle.crt to ./ [this is openssl's]

run curl --cacert ./ca-bundle.crt https://launchpad.net
result: html
-------------------------------------------------------
I have not looked into the libcurl code itself.

However, from the curl.spec in the src.rpm, the configuration looks good:
  --with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt

but the there is this:

run:  curl-config --ca
result: @CURL_CA_BUNDLE@

Comment 1 Gene Czarcinski 2008-07-05 15:18:42 UTC
also reported upstream:
http://sourceforge.net/tracker/index.php?func=detail&aid=2011303&group_id=976&atid=100976

Comment 2 Gene Czarcinski 2008-07-05 19:32:15 UTC
As I get more information, I am adding it to the upstream report so track that
report.

It is sure looking like something in libcurl (nss.c for now).

Any suggestions appreciated.

Comment 3 Jindrich Novy 2008-07-07 11:20:01 UTC
Thanks for reporting, at least the curl-config --ca reporting @CURL_CA_BUNDLE@
looks pretty broken as it seems unevaluated by configure.

Comment 4 Gene Czarcinski 2008-07-07 14:15:05 UTC
There is something really strange going on in curl/libcurl when success or. 
failure depends on specify "-v".  This tells me there might be an uninitialized
variable somwhere of that a versiable is getting different values depending on
the codepath.  

"ca-bundle.crt is copied from "/etc/pki/tls/certs/"
--------------------------------------------------------------------------
[gc@falcon test]$ curl  --cacert ./cacert.pem https://launchpad.net >xxx
  % Total    % Received % Xferd  Average Speed   Time    Time     Time 
Current
                                 Dload  Upload   Total   Spent    Left 
Speed
100 13706  100 13706    0     0  10244      0  0:00:01  0:00:01 --:--:--
69573
---------------------------------------------------------------------------
[gc@falcon test]$ curl  --cacert ./ca-bundle.crt  https://launchpad.net
>xxx
  % Total    % Received % Xferd  Average Speed   Time    Time     Time 
Current
                                 Dload  Upload   Total   Spent    Left 
Speed
100 13706  100 13706    0     0  11259      0  0:00:01  0:00:01 --:--:--
69573
-----------------------------------------------------------------------------------
[gc@falcon test]$ curl -v  --cacert ./ca-bundle.crt  https://launchpad.net
>xxx
* About to connect() to launchpad.net port 443 (#0)
*   Trying 91.189.90.211... connected
* Connected to launchpad.net (91.189.90.211) port 443 (#0)
*   CAfile: ./ca-bundle.crt
  CApath: none
* Bad certificate received. Subject = 'CN=launchpad.net,OU=Domain Control
Validated,O=launchpad.net', Issuer =
'E=practices,CN=Starfield Secure Certification
Authority,OU=http://www.starfieldtech.com/repository,O="Starfield
Technologies, Inc.",L=Scottsdale,ST=Arizona,C=US'
* NSS error -8179
* Closing connection #0
* Peer certificate cannot be authenticated with known CA certificates

curl: (60) Peer certificate cannot be authenticated with known CA
certificates
More details here: http://curl.haxx.se/docs/sslcerts.html


Comment 5 Toshio Kuratomi 2008-07-08 23:27:29 UTC
That command works for me::

[badger@Clingman tmp]$ curl -v --cacert /etc/pki/tls/certs/ca-bundle.crt
https://launchpad.net>xxx
* About to connect() to launchpad.net port 443 (#0)
*   Trying 91.189.90.211... connected
* Connected to launchpad.net (91.189.90.211) port 443 (#0)
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using SSL_RSA_WITH_RC4_128_MD5
* Server certificate:
* 	subject: CN=launchpad.net,OU=Domain Control Validated,O=launchpad.net
* 	start date: Jul 25 18:24:13 2006 GMT
* 	expire date: Jul 25 18:24:13 2009 GMT
* 	common name: launchpad.net
* 	issuer: E=practices,CN=Starfield Secure Certification
Authority,OU=http://www.starfieldtech.com/repository,O="Starfield Technologies,
Inc.",L=Scottsdale,ST=Arizona,C=US
> GET / HTTP/1.1
> User-Agent: curl/7.18.2 (i386-redhat-linux-gnu) libcurl/7.18.2 NSS/3.12.0.3
zlib/1.2.3 libidn/0.6.14
> Host: launchpad.net
> Accept: */*
> 
< HTTP/1.1 200 Ok
< Date: Tue, 08 Jul 2008 23:24:12 GMT
< Server: zope.server.http (HTTP)
< X-Powered-By: Zope (www.zope.org), Python (www.python.org)
< Content-Length: 13706
< Content-Type: text/html;charset=utf-8
< Set-Cookie: lp=Oagcw-BgHWWV7PnBux2Gia6LvrYkn3vlMb-fhHglhaJYfEDRlyO5uU;
Domain=.launchpad.net; expires=Wed, 08 Jul 2009 23:24:12 GMT; Path=/; secure;
< Via: 1.1 launchpad.net
< Vary: Accept-Encoding
< 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 13706    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0{
[data not shown]
100 13706  100 13706    0     0  10699      0  0:00:01  0:00:01 --:--:-- 31009*
Connection #0 to host launchpad.net left intact

* Closing connection #0

My machine is Fedora 9 with the following packages::

nss-3.12.0.3-0.9.1.fc9.i386
curl-7.18.2-1.fc9.i386
libcurl-7.18.2-1.fc9.i386
glibc-2.8-3.i686
openssl-0.9.8g-9.fc9.i686


Comment 6 Gene Czarcinski 2008-07-09 04:43:14 UTC
Yes, and it works for me too sometimes and under some conditions.

One thing I notice is that you are running i386 whereas I am running x86_64.

We are running the same maintenance level ... package version/release.

Why does it work for me if I copy ca-bundle.crt to my local directory to be used
with --cacert ./ca-bundle.crt but then not work when I add "-v"

OK, I just tried it on a x86_64 laptop and it worked (with or without the -v). 
But I was not current with  nss so I updated to the latest ... and it stopped
working correctly ... install --oldpackage .. worked but now did not work with "-v"

I tried installing --oldpackage nss on my desktops, but they did not work.

It does work consistently on a i386 install vmware virtual with current maintenance.

I can get it to consistently work or not work but I have no idea what the
precise conditions are.



Comment 7 Gene Czarcinski 2008-07-09 13:28:55 UTC
I have also opened a bug report with curl/libcurl upstream:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2011303&group_id=976

I have also used wireshark to capture the packets for a "works" and a "woes not
work" situation.  I am attaching plain text exports of the certificate packet in
both cases.  I am not really knowledgeable at this level but (to me) the
certificates look the same.

Comment 8 Gene Czarcinski 2008-07-09 13:30:01 UTC
Created attachment 311375 [details]
"works" certificate packet

Comment 9 Gene Czarcinski 2008-07-09 13:32:44 UTC
Created attachment 311376 [details]
"does not work" certificate packet

In this case, libcurl says this is a bad certificate

* Bad certificate received. Subject = 'CN=launchpad.net,OU=Domain Control
Validated,O=launchpad.net', Issuer =
'E=practices,CN=Starfield Secure Certification
Authority,OU=http://www.starfieldtech.com/repository,O="Starfield Technologies,
Inc.",L=Scottsdale,ST=Arizona,C=US'

curl: (60) Peer certificate cannot be authenticated with known CA certificates

Comment 10 Gene Czarcinski 2008-07-09 13:34:27 UTC
Changing to "x86_64" from "all" since the only systems I have problems on (I
tried several) are all running x86_64 Fedora 9.

Comment 11 Gene Czarcinski 2008-07-29 11:56:09 UTC
Interesting, the curl/libcurl folks upstream claim that fedora screwed things up
and are not looking at the problem ... in fact, they auto-closed the problem ...
not friendly at all!!

https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2011303&group_id=976



Comment 12 Fedora Admin XMLRPC Client 2009-04-03 09:22:25 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 13 Kamil Dudka 2009-05-14 12:53:45 UTC
Is the bug still present in up to date Fedora 9 (with curl-7.19.4-5.fc9)?

It seems like already fixed:

$ curl-config --ca
/etc/pki/tls/certs/ca-bundle.crt

$ curl --silent --verbose https://launchpad.net > /dev/null
...
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
*       subject: CN=launchpad.net,OU=Domain Control Validated,O=launchpad.net
*       start date: Jul 25 18:24:13 2006 GMT
*       expire date: Jul 25 18:24:13 2009 GMT
*       common name: launchpad.net
*       issuer: E=practices,CN=Starfield Secure Certification Authority,OU=http://www.starfieldtech.com/repository,O="Starfield Technologies, Inc.",L=Scottsdale,ST=Arizona,C=US
> GET / HTTP/1.1
> User-Agent: curl/7.19.4 (x86_64-unknown-linux-gnu) libcurl/7.19.4 NSS/3.12.3 zlib/1.2.3 libidn/0.6.14 libssh2/0.18
> Host: launchpad.net
> Accept: */*
>
< HTTP/1.1 200 OK
...

Comment 14 Kamil Dudka 2009-05-22 19:26:40 UTC
Setting state to NEW as the bug is still unconfirmed.

Comment 15 Bug Zapper 2009-06-10 01:55:59 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 16 Bug Zapper 2009-07-14 15:39:33 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


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