Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

TorSocket.isConnected always returns false #19

@craigraw

Description

@craigraw

TorSocket delegates the socket.isConnected() call to SocksSocket which always returns false, even when the TorSocket has successfully connected to the endpoint.

This is a problem when wrapping the TorSocket in a java SSLSocket, as the first thing that SSLSocketImpl does is check if the socket is connected:
if (!sock.isConnected()) { throw new SocketException("Underlying socket is not connected"); }

While it's unnecessary to wrap Tor connections in SSL, sometimes you don't get a choice of server protocol.

A workaround is to use Java reflection to retrieve SocksSocket from TorSocket and set the connected member variable to true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions