This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zielmicha
Recipients zielmicha
Date 2013-08-29.21:36:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377812218.52.0.68669263864.issue18880@psf.upfronthosting.co.za>
In-reply-to
Content
SSLSocket documentation mentions shutdown as analogue to socket.shutdown. However, instead of forbidding communication, it removes SSL wrapper from socket. For example, the following script doesn't work and returns garbage:

    import socket
    import ssl

    s = socket.socket()
    s.connect(('google.com', 443))
    client = ssl.wrap_socket(s)
    client.sendall(b'GET / HTTP/1.0\nConnection: close\n\n')
    client.shutdown(socket.SHUT_WR)

    print(repr(client.recv(40)))

Attached patch makes shutdown raise exception if how != SHUT_RDWR, as closing one side of socket over SSL doesn't make sense (unless I'm missing something).
History
Date User Action Args
2013-08-29 21:36:58zielmichasetrecipients: + zielmicha
2013-08-29 21:36:58zielmichasetmessageid: <1377812218.52.0.68669263864.issue18880@psf.upfronthosting.co.za>
2013-08-29 21:36:58zielmichalinkissue18880 messages
2013-08-29 21:36:58zielmichacreate