> @@ -128,23 +132,44 @@ public JschSshClient(ProxyConfig proxyConfig, > BackoffLimitedRetryHandler backoff > this.user = checkNotNull(loginCredentials, > "loginCredentials").getUser(); > this.host = checkNotNull(socket, "socket").getHostText(); > checkArgument(socket.getPort() > 0, "ssh port must be greater then > zero" + socket.getPort()); > - checkArgument(loginCredentials.getPassword() != null || > loginCredentials.getPrivateKey() != null, > - "you must specify a password or a key"); > + checkArgument(loginCredentials.getPassword() != null || > hasValidPrivateKey(loginCredentials) || getSSHAgentConnector() != null,
Looking at the code that is actually pretty cheap. The connectors make minimal initialization and do a best effort check to find available agents. Also that is platform specific. The connectors don't have significant resources before querying the keys. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/312/files#r10861295