Bug 671133 - IPv6 support in httplib.py
Summary: IPv6 support in httplib.py
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python
Version: 5.5
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Dave Malcolm
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
: 796076 (view as bug list)
Depends On:
Blocks: spaceIPv6 790326
TreeView+ depends on / blocked
 
Reported: 2011-01-20 14:06 UTC by Jan Hutař
Modified: 2013-03-21 04:36 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-21 04:36:55 UTC


Attachments (Terms of Use)
This helped me to get it working (629 bytes, patch)
2011-01-20 14:08 UTC, Jan Hutař
no flags Details | Diff

Comment 1 Jan Hutař 2011-01-20 14:08:29 UTC
Created attachment 474465 [details]
This helped me to get it working

I have used info from:

https://wikispaces.psu.edu/display/ipv6/IPv6+and+Python

Comment 2 Jan Hutař 2011-01-25 10:02:21 UTC
On RHEL6 this was needed:

# diff -u /usr/lib64/python2.6/socket.py.ORIG /usr/lib64/python2.6/socket.py
--- /usr/lib64/python2.6/socket.py.ORIG	2011-01-25 04:34:27.682089250 -0500
+++ /usr/lib64/python2.6/socket.py	2011-01-25 04:34:48.335090298 -0500
@@ -501,7 +501,7 @@
         af, socktype, proto, canonname, sa = res
         sock = None
         try:
-            sock = socket(af, socktype, proto)
+            sock = socket(AF_INET6, socktype, proto)
             if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                 sock.settimeout(timeout)
             sock.connect(sa)

and then I ran into bug 665013.

Comment 3 RHEL Product and Program Management 2011-05-31 14:33:43 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 4 Jan Pazdziora 2011-07-21 14:49:53 UTC
Removing from space15 as this is RHEL bugzilla.

Comment 6 RHEL Product and Program Management 2011-10-26 19:47:39 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 8 Miroslav Suchý 2011-10-27 07:51:22 UTC
Note that it is the same symptom as bug 739625 so I would bet that the real problem is in m2crypto, which is for rhel6 tracked as bug 742914.

Comment 9 Jan Pazdziora 2011-10-27 08:04:59 UTC
Do things work when you use http instead of https?

Comment 10 Jan Hutař 2011-10-27 08:07:19 UTC
Making initial comment private. Public version:



Description of problem:
I'm using httplib.py through xmlrpclib.py to communicate with XMLRPC server
(RHN Satellite in this case) through IPv6-only network. I'm getting a
traceback, although when I add IPv4 address to /etc/hosts, it works as
expected.


Version-Release number of selected component (if applicable):
python-2.4.3-27.el5


How reproducible:
always


Steps to Reproduce:
1. # python
   Python 2.4.3 (#1, Jun 11 2009, 14:09:37) 
   [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import xmlrpclib
   >>> client = xmlrpclib.Server('https://<fqdn>/rpc/api', verbose=0)
   >>> key = client.auth.login('admin', 'passwd')
2. I'm on system when server is accessible only through IPv6, no IPv4
   # ping <fqdn>
   ping: unknown host <fqdn>
3. # ping6 -c 1 <fqdn>
   PING <fqdn>(<fqdn>) 56 data bytes
   64 bytes from <fqdn>: icmp_seq=0 ttl=64 time=0.213 ms
   --- <fqdn> ping statistics ---
   1 packets transmitted, 1 received, 0% packet loss, time 0ms
   rtt min/avg/max/mdev = 0.213/0.213/0.213/0.000 ms, pipe 2


Actual results:
Traceback (most recent call last):
  File "./manage-ak.py", line 64, in ?
    key = client.auth.login(USER, PASS)
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1096, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1383, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1129, in request
    self.send_content(h, request_body)
  File "/usr/lib64/python2.4/xmlrpclib.py", line 1243, in send_content
    connection.endheaders()
  File "/usr/lib64/python2.4/httplib.py", line 804, in endheaders
    self._send_output()
  File "/usr/lib64/python2.4/httplib.py", line 685, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.4/httplib.py", line 652, in send
    self.connect()
  File "/usr/lib64/python2.4/httplib.py", line 1084, in connect
    sock.connect((self.host, self.port))
  File "<string>", line 1, in connect
socket.gaierror: (-2, 'Name or service not known')


Expected results:
Should work


Additional info:
This might be NOTABUG or a duplicate. I'm filling it to be sure this is known
and what I'm doing is correct.

Comment 11 Jan Hutař 2011-10-27 08:20:20 UTC
(In reply to comment #9)
> Do things work when you use http instead of https?

Preparing environment now:

https://beaker.engineering.redhat.com/jobs/148593

but from what I recall, you are right, http://... worked as expected.

Comment 12 Milan Zázrivec 2011-10-27 08:46:13 UTC
(In reply to comment #8)
> Note that it is the same symptom as bug 739625 so I would bet that the real
> problem is in m2crypto, which is for rhel6 tracked as bug 742914.

The symptoms may be the same here, but the root cause is different.

From httplib.py:
...
class HTTPSConnection

    def connect(self):
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect((self.host, self.port))
...

Comment 13 Jan Hutař 2011-11-02 09:32:41 UTC
(In reply to comment #9)
> Do things work when you use http instead of https?

Yes, I can log-in (with "client.auth.login('admin', 'password')") when on http instead of https.

Comment 14 Milan Zázrivec 2012-02-22 15:55:55 UTC
*** Bug 796076 has been marked as a duplicate of this bug. ***

Comment 15 RHEL Product and Program Management 2012-10-30 05:50:03 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 17 RHEL Product and Program Management 2013-03-21 04:36:55 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


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