Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Wrapping an existing transport in SSL #492

Open
kyuupichan opened this issue Feb 12, 2017 · 2 comments
Open

Wrapping an existing transport in SSL #492

kyuupichan opened this issue Feb 12, 2017 · 2 comments

Comments

@kyuupichan
Copy link

kyuupichan commented Feb 12, 2017

I hope a question is acceptable here; I've googled and not found an answer.

I want to connect to a remote Tor server listening on an SSL socket with asyncio.

I have created an asyncio SocksProtocol to handle the negotation with the local tor proxy, and this works fine to establish a connection with the remote Tor server via loop.create_connection. However that leaves me with a transport, protocol pair, and I need to wrap the transport in SSL for the app to communicate properly with the remote server.

I don't see a clean way to do this. One thing I tried was another loop.connection passing the transport's socket and an ssl arg, but that didn't work as it ends up triggering checks in asyncio because 2 transports are using the same base socket. Am I missing something obvious?

@FranciscoSilveira
Copy link

Asyncio has support for SSL itself, so instead of creating a TCP transport and then wrapping that around SSL, you could just create a SSL transport from the beginning.

@kyuupichan
Copy link
Author

That would be an SSL transport to the tor proxy, which I believe only expects TCP by default, not an SSL transport to the remote Tor server, which is the goal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants