Class Socks5ClientConnector

    • Constructor Detail

      • Socks5ClientConnector

        public Socks5ClientConnector​(@NonNull
                                     java.net.InetSocketAddress proxyAddress,
                                     @NonNull
                                     java.net.InetSocketAddress remoteAddress)
        Creates a new Socks5ClientConnector. The connector supports anonymous connections as well as username-password or Kerberos5 (GSS-API) authentication.
        Parameters:
        proxyAddress - of the proxy server we're connecting to
        remoteAddress - of the target server to connect to
      • Socks5ClientConnector

        public Socks5ClientConnector​(@NonNull
                                     java.net.InetSocketAddress proxyAddress,
                                     @NonNull
                                     java.net.InetSocketAddress remoteAddress,
                                     java.lang.String proxyUser,
                                     char[] proxyPassword)
        Creates a new Socks5ClientConnector. The connector supports anonymous connections as well as username-password or Kerberos5 (GSS-API) authentication.
        Parameters:
        proxyAddress - of the proxy server we're connecting to
        remoteAddress - of the target server to connect to
        proxyUser - to authenticate at the proxy with
        proxyPassword - to authenticate at the proxy with
    • Method Detail

      • sendClientProxyMetadata

        public void sendClientProxyMetadata​(org.apache.sshd.client.session.ClientSession sshSession)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAuthenticationProposals

        private byte[] getAuthenticationProposals()
      • sendConnectInfo

        private void sendConnectInfo​(org.apache.sshd.common.io.IoSession session)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doPasswordAuth

        private void doPasswordAuth​(org.apache.sshd.common.io.IoSession session)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doGssApiAuth

        private void doGssApiAuth​(org.apache.sshd.common.io.IoSession session)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        private void close()
      • startAuth

        private void startAuth​(org.apache.sshd.common.io.IoSession session)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • authStep

        private void authStep​(org.apache.sshd.common.io.IoSession session,
                              org.apache.sshd.common.util.buffer.Buffer input)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • establishConnection

        private void establishConnection​(org.apache.sshd.common.util.buffer.Buffer data)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • messageReceived

        public void messageReceived​(org.apache.sshd.common.io.IoSession session,
                                    org.apache.sshd.common.util.Readable buffer)
                             throws java.lang.Exception
        Description copied from interface: StatefulProxyConnector
        Handle a received message.
        Parameters:
        session - to use for writing data
        buffer - received data
        Throws:
        java.lang.Exception - if data cannot be read, or the connection attempt fails
      • versionCheck

        private void versionCheck​(byte version)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getRawAddress

        private static byte[] getRawAddress​(@NonNull
                                            java.net.InetSocketAddress address)
      • getGSSContext

        private static org.ietf.jgss.GSSContext getGSSContext​(@NonNull
                                                              java.net.InetSocketAddress address)