Issue491477

classification
Title: HTTPSConnection uses socket.ssl()
Type: rfe Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bckfnn, che_fox
Priority: normal Keywords:

Created on 2001-12-11.08:55:54 by che_fox, last changed 2001-12-11.21:00:21 by bckfnn.

Messages
msg3006 (view) Author: Ben Gertzfield (che_fox) Date: 2001-12-11.08:55:54
The httplib.HTTPSConnection class uses the 
socket.ssl() function, which doesn't exist, in the 
HTTPSConnection.connect() function.

    def connect(self):
        "Connect to a host on a given (SSL) port."

        sock = socket.socket(socket.AF_INET, 
socket.SOCK_STREAM)
        sock.connect((self.host, self.port))
        ssl = socket.ssl(sock, self.key_file, 
self.cert_file)
        self.sock = FakeSocket(sock, ssl)

Trying to use HTTPSConnection.request() results in an 
AttributeError:

>>> h = httplib.HTTPSConnection("apply.test.jprs.jp")
>>> h.request("POST", "/transact.cgi", body=body, 
headers=headers)
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "/home/ben/jython-2.0/Lib/httplib.py", line 
492, in request
  File "/home/ben/jython-2.0/Lib/httplib.py", line 
500, in _send_request
  File "/home/ben/jython-2.0/Lib/httplib.py", line 
426, in putrequest
  File "/home/ben/jython-2.0/Lib/httplib.py", line 
367, in send
  File "/home/ben/jython-2.0/Lib/httplib.py", line 
616, in connect
AttributeError: module 'socket' has no attribute 'ssl'

Ben

msg3007 (view) Author: Finn Bock (bckfnn) Date: 2001-12-11.21:00:21
Logged In: YES 
user_id=4201

Your observation is correct; Jython have no support SSL. 
I'll change the bugreport into a feature request, maybe 
somebody will pick it up and implement a python compatible 
SSL for jython.
History
Date User Action Args
2001-12-11 08:55:54che_foxcreate