mirror of https://github.com/apache/jclouds.git
JCLOUDS-884: Only try netcat over ssh-agent as an agentproxy
See http://markmail.org/thread/oto47qk2kzcdtebb
This commit is contained in:
parent
0c6052f803
commit
7f38520314
|
@ -53,8 +53,14 @@ public class JschSshClientModule extends AbstractModule {
|
||||||
Optional<Connector> agentConnector = getAgentConnector();
|
Optional<Connector> agentConnector = getAgentConnector();
|
||||||
|
|
||||||
Optional<Connector> getAgentConnector() {
|
Optional<Connector> getAgentConnector() {
|
||||||
|
ConnectorFactory sshAgentOverNetcatOnly = new ConnectorFactory() {
|
||||||
|
{
|
||||||
|
setPreferredConnectors("ssh-agent");
|
||||||
|
setPreferredUSocketFactories("nc");
|
||||||
|
}
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
return Optional.of(ConnectorFactory.getDefault().createConnector());
|
return Optional.of(sshAgentOverNetcatOnly.createConnector());
|
||||||
} catch (final AgentProxyException e) {
|
} catch (final AgentProxyException e) {
|
||||||
return Optional.absent();
|
return Optional.absent();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class SshjSshClientModule extends AbstractModule {
|
||||||
bind(SshClient.Factory.class).to(Factory.class).in(Scopes.SINGLETON);
|
bind(SshClient.Factory.class).to(Factory.class).in(Scopes.SINGLETON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static class Factory implements SshClient.Factory {
|
private static class Factory implements SshClient.Factory {
|
||||||
@Named(Constants.PROPERTY_CONNECTION_TIMEOUT)
|
@Named(Constants.PROPERTY_CONNECTION_TIMEOUT)
|
||||||
@Inject(optional = true)
|
@Inject(optional = true)
|
||||||
|
@ -51,8 +50,14 @@ public class SshjSshClientModule extends AbstractModule {
|
||||||
Optional<Connector> agentConnector = getAgentConnector();
|
Optional<Connector> agentConnector = getAgentConnector();
|
||||||
|
|
||||||
Optional<Connector> getAgentConnector() {
|
Optional<Connector> getAgentConnector() {
|
||||||
|
ConnectorFactory sshAgentOverNetcatOnly = new ConnectorFactory() {
|
||||||
|
{
|
||||||
|
setPreferredConnectors("ssh-agent");
|
||||||
|
setPreferredUSocketFactories("nc");
|
||||||
|
}
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
return Optional.of(ConnectorFactory.getDefault().createConnector());
|
return Optional.of(sshAgentOverNetcatOnly.createConnector());
|
||||||
} catch (final AgentProxyException e) {
|
} catch (final AgentProxyException e) {
|
||||||
return Optional.absent();
|
return Optional.absent();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue