mirror of https://github.com/apache/jclouds.git
Use ssh agent if privatekey and password are not set
This commit is contained in:
parent
b1231257fd
commit
522c080a4a
|
@ -169,7 +169,7 @@ public final class SessionConnection implements Connection<Session> {
|
|||
.getSession(loginCredentials.getUser(), hostAndPort.getHostText(), hostAndPort.getPortOrDefault(22));
|
||||
if (sessionTimeout != 0)
|
||||
session.setTimeout(sessionTimeout);
|
||||
if (!loginCredentials.getOptionalPrivateKey().isPresent()) {
|
||||
if (loginCredentials.getOptionalPassword().isPresent()) {
|
||||
session.setPassword(loginCredentials.getOptionalPassword().orNull());
|
||||
} else if (loginCredentials.hasUnencryptedPrivateKey()) {
|
||||
byte[] privateKey = loginCredentials.getOptionalPrivateKey().get().getBytes();
|
||||
|
|
Loading…
Reference in New Issue