- final ClientFactoryManagerConfigurator configurator = factoryMgr -> {
- factoryMgr.setServerKeyVerifier(this::verifyServerKey);
- factoryMgr.addSessionListener(createSessionListener());
- // supported auth factories
- factoryMgr.setUserAuthFactories(List.of(new UserAuthPasswordFactory(), new UserAuthPublicKeyFactory()));
+ final var configurator = new ClientFactoryManagerConfigurator() {
+ @Override
+ protected void configureClientFactoryManager(final ClientFactoryManager factoryManager) {
+ factoryManager.setServerKeyVerifier((clientSession, remoteAddress, serverKey)
+ -> verifyServerKey(clientSession, remoteAddress, serverKey));
+ factoryManager.addSessionListener(createSessionListener());
+ // supported auth factories
+ factoryManager.setUserAuthFactories(List.of(
+ new UserAuthPasswordFactory(),
+ new UserAuthPublicKeyFactory()));
+ }