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 njs
Recipients Greg Stark, christian.heimes, njs
Date 2017-05-23.07:43:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495525411.81.0.14535425117.issue29334@psf.upfronthosting.co.za>
In-reply-to
Content
Oddly, I expected to run into this with my code using SSLObject in trio [1], but if I connect to python.org:443 and then 'await trio_ssl_stream.do_handshake(); trio_ssl_stream.getpeercert()' it works just fine ... even though when I run the sslbugs.py script I get the same weird results Greg reports. As far as I can tell the logic is identical. So I guess this might potentially be useful to narrow this down :-).

Test code that works:

@trio.run
async def main():
    import trio
    sock = trio.socket.socket()
    addr = await sock.resolve_remote_address(("python.org", 443))
    await sock.connect(addr)
    s = trio.SocketStream(sock)
    client = trio.ssl.SSLStream(
        s, trio.ssl.create_default_context(), server_hostname="python.org")
    await client.do_handshake()
    print(client.getpeercert())

[1] Currently in https://github.com/python-trio/trio/pull/107, eventually will be at https://github.com/python-trio/trio/blob/master/trio/ssl.py
History
Date User Action Args
2017-05-23 07:43:31njssetrecipients: + njs, christian.heimes, Greg Stark
2017-05-23 07:43:31njssetmessageid: <1495525411.81.0.14535425117.issue29334@psf.upfronthosting.co.za>
2017-05-23 07:43:31njslinkissue29334 messages
2017-05-23 07:43:31njscreate