ashishkumar2804 opened a new issue, #340:
URL: https://github.com/apache/mina-sshd/issues/340

   I am getting below error while connecting to embedded server using sshclient 
   Server at localhost/127.0.0.1:2222 presented wrong key:
   
   Code to create embedded server
   `m_sshServer = SshServer.setUpDefaultServer();
           m_sshServer.setHost("localhost");
           m_sshServer.setPort(m_sftpPort);
           m_sshServer.setKeyPairProvider(new 
SimpleGeneratorHostKeyProvider(m_serverKeyPath));
           m_sshServer.setSubsystemFactories(getSftpSubsystemFactory());
           m_sshServer.setUserAuthFactories(getUserAuthFactory());
           m_sshServer.setPasswordAuthenticator(new 
SimplePasswordAuthenticator());
           m_sshServer.setFileSystemFactory(createVirtualFileSystemFactory());
           m_sshServer.start();
   `
   
   Code to connect using sshClient
   `SshClient sshClient = SshClient.setUpDefaultClient();
   sshClient.setServerKeyVerifier(new RequiredServerKeyVerifier(hostPublicKey));
   sshClient.start();
   connectFuture = m_sshClient.connect(m_config.getUserName(), 
m_config.getHostName(), m_config.getPort())
                       .verify((long)(m_config.getConnectionTimeoutSeconds() * 
MILLIS_PER_SECOND));
   clientSession = connectFuture.getClientSession();
   clientSession.addPasswordIdentity(m_config.getPassword());
               authFuture = clientSession.auth()
                       .verify((long)(m_config.getConnectionTimeoutSeconds() * 
MILLIS_PER_SECOND));
   `
   
   I am not sure, what I am missing, or where I am going wrong.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to