Search in sources :

Example 1 with ServerKeyVerifier

use of org.apache.sshd.client.ServerKeyVerifier in project gitblit by gitblit.

the class SshUnitTest method getClient.

protected SshClient getClient() {
    SshClient client = SshClient.setUpDefaultClient();
    client.setServerKeyVerifier(new ServerKeyVerifier() {

        @Override
        public boolean verifyServerKey(ClientSession sshClientSession, SocketAddress remoteAddress, PublicKey serverKey) {
            return true;
        }
    });
    client.start();
    return client;
}
Also used : SshClient(org.apache.sshd.client.SshClient) PublicKey(java.security.PublicKey) ClientSession(org.apache.sshd.client.session.ClientSession) ServerKeyVerifier(org.apache.sshd.client.ServerKeyVerifier) SocketAddress(java.net.SocketAddress)

Aggregations

SocketAddress (java.net.SocketAddress)1 PublicKey (java.security.PublicKey)1 ServerKeyVerifier (org.apache.sshd.client.ServerKeyVerifier)1 SshClient (org.apache.sshd.client.SshClient)1 ClientSession (org.apache.sshd.client.session.ClientSession)1