use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class AbstractBrickTest method setup.
@Before
public void setup() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new BrickProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Brick.cyberduckprofile"));
final Host host = new Host(profile, "mountainduck.files.com", new Credentials(System.getProperties().getProperty("brick.user"), System.getProperties().getProperty("brick.password")));
session = new BrickSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
fail(reason);
return null;
}
}, new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener());
login.check(session, new DisabledCancelCallback());
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class AbtractBoxTest method setup.
@Before
public void setup() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new BoxProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Box.cyberduckprofile"));
final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials("cyberduck"));
session = new BoxSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
fail(reason);
return null;
}
}, new DisabledHostKeyCallback(), new TestPasswordStore(), new DisabledProgressListener());
login.check(session, new DisabledCancelCallback());
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class DefaultSessionPoolTest method testConnectRefuse.
@Test(expected = ConnectionRefusedException.class)
public void testConnectRefuse() throws Exception {
final DefaultSessionPool pool = new DefaultSessionPool(new TestLoginConnectionService() {
@Override
public boolean check(final Session<?> session, final CancelCallback callback) throws BackgroundException {
throw new ConnectionRefusedException("t", new RuntimeException());
}
}, new DisabledX509TrustManager(), new DefaultX509KeyManager(), new DefaultVaultRegistry(new DisabledPasswordCallback()), new DisabledTranscriptListener(), new Host(new TestProtocol(), "t"));
pool.borrow(BackgroundActionState.running);
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class DefaultSessionPoolTest method testCheckReconnectApplicationFailure.
@Test
public void testCheckReconnectApplicationFailure() throws Exception {
final AtomicBoolean interrupt = new AtomicBoolean();
final Host bookmark = new Host(new TestProtocol());
final TestLoginConnectionService connect = new TestLoginConnectionService() {
@Override
public boolean check(final Session<?> session, final CancelCallback callback) {
return true;
}
};
final DefaultSessionPool pool = new DefaultSessionPool(connect, new DefaultVaultRegistry(new DisabledPasswordCallback()), new DisabledTranscriptListener(), bookmark, new GenericObjectPool<Session>(new PooledSessionFactory(connect, new DisabledX509TrustManager(), new DefaultX509KeyManager(), bookmark, new DefaultVaultRegistry(new DisabledPasswordCallback())) {
@Override
public Session create() {
return new NullSession(bookmark) {
@Override
public void interrupt() throws BackgroundException {
interrupt.set(true);
super.interrupt();
}
};
}
}));
final Session<?> session = pool.borrow(BackgroundActionState.running);
pool.release(session, new BackgroundException("m", "d"));
assertFalse(interrupt.get());
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class DefaultSessionPoolTest method testCheckReconnectSocketFailure.
@Test
public void testCheckReconnectSocketFailure() throws Exception {
final AtomicBoolean interrupt = new AtomicBoolean();
final Host bookmark = new Host(new TestProtocol());
final TestLoginConnectionService connect = new TestLoginConnectionService() {
@Override
public boolean check(final Session<?> session, final CancelCallback callback) {
return true;
}
};
final DefaultSessionPool pool = new DefaultSessionPool(connect, new DefaultVaultRegistry(new DisabledPasswordCallback()), new DisabledTranscriptListener(), bookmark, new GenericObjectPool<Session>(new PooledSessionFactory(connect, new DisabledX509TrustManager(), new DefaultX509KeyManager(), bookmark, new DefaultVaultRegistry(new DisabledPasswordCallback())) {
@Override
public Session create() {
return new NullSession(bookmark) {
@Override
public void interrupt() throws BackgroundException {
interrupt.set(true);
super.interrupt();
}
};
}
}));
final Session<?> session = pool.borrow(BackgroundActionState.running);
pool.release(session, new BackgroundException("m", new SocketException("m")));
assertTrue(interrupt.get());
}
Aggregations