eshad / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

https connection failure #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. trying to make https request using simple client:
import httplib2
h = httplib2.Http('.cache')
resp, content = h.request("https://localhost:8001", "GET")

What is the expected output? 
 a successful response 

What do you see instead?
 Error erased.
Traceback (most recent call last):
  File "testing/restInterfaceTest2-ssl.py", line 4, in <module>
    resp, content = h.request("https://localhost:8001", "GET")
  File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 1129, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 901, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 871, in _conn_request
    response = conn.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 988, in getresponse
    method=self._method)
  File "/usr/lib/python2.6/httplib.py", line 330, in __init__
    self.fp = sock.makefile('rb', 0)
AttributeError: 'NoneType' object has no attribute 'makefile'

What version of the product are you using? On what operating system?
* Ubuntu 10.10
* Python 2.6.6
* python-httplib2 0.6.0b2

Please provide any additional information below.

Original issue reported on code.google.com by damian.p...@gmail.com on 30 May 2011 at 11:50

GoogleCodeExporter commented 9 years ago
I get that issue when I try doing an https:// request for a server that doesn't 
actually support HTTPS. The server is closing the connection and that's what 
this error amounts to.

Are you sure your localhost server on port 8001 supports HTTPS?

Original comment by travis.p...@gmail.com on 31 May 2011 at 8:25

GoogleCodeExporter commented 9 years ago
I have started HTTPS server on port 8001 myself. Additionally I have prepared 
the testing client using httplib module which is working fine:

import httplib
conn = httplib.HTTPSConnection('localhost:8001')

conn.request('GET', '/')
res = conn.getresponse()
print res.read()

So for me, it looks that there is a problem in httplib2 :/ 

Original comment by damian.p...@gmail.com on 1 Jun 2011 at 11:15

GoogleCodeExporter commented 9 years ago
Fixed in head.

Original comment by joe.gregorio@gmail.com on 13 Jun 2011 at 4:48