commit d430f7631b8a6ce7149e870422e217e07c80f70f Author: Damian Johnson atagar@torproject.org Date: Sun Dec 31 20:21:44 2017 -0800
SSL for RelaySocket connections
Now that I've dug a bit further turns out that all ORPort connections are ssl encrypted (endosome was only providing plain sockets for the DirPort). --- stem/socket.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/stem/socket.py b/stem/socket.py index 1b9cea5f..01626068 100644 --- a/stem/socket.py +++ b/stem/socket.py @@ -74,6 +74,7 @@ from __future__ import absolute_import import io import re import socket +import ssl import threading import time
@@ -414,7 +415,7 @@ class RelaySocket(BaseSocket): try: relay_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) relay_socket.connect((self.address, self.port)) - return relay_socket + return ssl.wrap_socket(relay_socket) except socket.error as exc: raise stem.SocketError(exc)
tor-commits@lists.torproject.org