Bug 1012086

Summary: packagekit tracebacks on handshake error
Product: Red Hat Enterprise Linux 6 Reporter: Karel Srot <ksrot>
Component: rhn-client-toolsAssignee: Michael Mráka <mmraka>
Status: CLOSED WONTFIX QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: low    
Version: 6.4CC: cperry, mmraka, tpelka
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-14 06:53:31 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:
Attachments:
Description Flags
error window none

Description Karel Srot 2013-09-25 16:38:53 UTC
when connecting through a hotel wifi I got following error from the packagekit:

Error Type: <class 'up2date_client.up2dateErrors.NetworkError'>
Error Value: Network error: ssl handshake failure
  File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 3278, in <module>
    main()
  File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 3274, in main
    backend = PackageKitYumBackend('', lock=True)
  File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 238, in __init__
    self.doLock()
  File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 321, in doLock
    self.yumbase.doLock(YUM_PID_FILE)
  File : /usr/lib/python2.6/site-packages/yum/__init__.py, line 1803, in doLock
    if self.conf.uid != 0:
  File : /usr/lib/python2.6/site-packages/yum/__init__.py, line 891, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File : /usr/lib/python2.6/site-packages/yum/__init__.py, line 362, in _getConfig
    self.plugins.run('init')
  File : /usr/lib/python2.6/site-packages/yum/plugins.py, line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File : /usr/share/yum-plugins/rhnplugin.py, line 115, in init_hook
    login_info = up2dateAuth.getLoginInfo()
  File : /usr/share/rhn/up2date_client/up2dateAuth.py, line 219, in getLoginInfo
    login()
  File : /usr/share/rhn/up2date_client/up2dateAuth.py, line 186, in login
    li = server.up2date.login(systemId)
  File : /usr/share/rhn/up2date_client/rhnserver.py, line 51, in __call__
    return rpcServer.doCall(method, *args, **kwargs)
  File : /usr/share/rhn/up2date_client/rpcServer.py, line 205, in doCall
    ret = method(*args, **kwargs)
  File : /usr/lib64/python2.6/xmlrpclib.py, line 1199, in __call__
    return self.__send(self.__name, args)
  File : /usr/share/rhn/up2date_client/rpcServer.py, line 39, in _request1
    ret = self._request(methodname, params)
  File : /usr/lib/python2.6/site-packages/rhn/rpclib.py, line 383, in _request
    self._handler, request, verbose=self._verbose)
  File : /usr/lib/python2.6/site-packages/rhn/transports.py, line 171, in request
    headers, fd = req.send_http(host, handler)
  File : /usr/lib/python2.6/site-packages/rhn/transports.py, line 704, in send_http
    headers=self.headers)
  File : /usr/lib64/python2.6/httplib.py, line 914, in request
    self._send_request(method, url, body, headers)
  File : /usr/lib64/python2.6/httplib.py, line 951, in _send_request
    self.endheaders()
  File : /usr/lib64/python2.6/httplib.py, line 908, in endheaders
    self._send_output()
  File : /usr/lib64/python2.6/httplib.py, line 780, in _send_output
    self.send(msg)
  File : /usr/lib64/python2.6/httplib.py, line 759, in send
    self.sock.sendall(str)
  File : /usr/lib/python2.6/site-packages/rhn/SSL.py, line 217, in write
    sent = self._connection.send(data)


The reason for this is that prior every connection the browser is redirected to a web page where the user is supposed to authenticate.

# nc 62.75.23.172 80
GET HTTP/1.0

HTTP/1.1 302 Hotspot login required
Cache-Control: no-cache
Content-Length: 135
Content-Type: text/html
Date: Sat, 21 Sep 2013 07:27:53 GMT
Expires: 0
Location: http://portal.mikenopa.com/login?dst=http%3A%2F%2FHTTP%2F1.0%2F

<html>
<head><title>Error 302: Hotspot login required</title></head>
<body>
<h1>Error 302: Hotspot login required</h1>
</body>
</html>

I think that this is happening also for SSL connections and therefore the handshake fails.


# openssl s_client -connect whateverdomain.com:443 -debug
CONNECTED(00000003)
write to 0x21ab9a0 [0x224bca0] (112 bytes => 112 (0x70))
0000 - 16 03 01 00 6b 01 00 00-67 03 01 52 3d 49 cd 8a   ....k...g..R=I..
0010 - ec 1f 9b 96 12 51 47 c6-44 7c 38 5a 0e d1 97 d8   .....QG.D|8Z....
0020 - 88 08 28 ca a4 e8 e9 ca-a3 6a 07 00 00 3a 00 39   ..(......j...:.9
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............
0060 - 00 08 00 06 00 03 00 ff-01 00 00 04 00 23         .............#
0070 - <SPACES/NULS>
read from 0x21ab9a0 [0x2251200] (7 bytes => 0 (0x0))
140436423456584:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:184:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 112 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---


# yum update
Loaded plugins: product-id, refresh-packagekit, rhnplugin, security,
              : subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Network error: ssl handshake failure

# curl -v https://whateverdomain.com
* About to connect() to whateverdomain.com port 443 (#0)
*   Trying 74.117.117.118... connected
* Connected to whateverdomain.com (74.117.117.118) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* NSS error -5938
* Closing connection #0
* SSL connect error
curl: (35) SSL connect error


Anyway, instead of an error window with traceback an error message about failed connection would be probably more appropriate. 

PackageKit-yum-0.5.8-21.el6.x86_64

Comment 1 Karel Srot 2013-09-25 16:39:38 UTC
Created attachment 802946 [details]
error window

Comment 2 Richard Hughes 2014-04-04 16:36:41 UTC
I'm pretty sure this is a yum/rhn-client bug; PackageKit can't catch private exceptions like up2date_client.up2dateErrors.NetworkError -- I mean I could catch all exceptions but I can't report a decent message to the user in that case.

Richard

Comment 3 RHEL Program Management 2014-11-10 14:25:48 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.