use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class DAVSessionTest method testLoginNTLM.
@Test
public void testLoginNTLM() throws Exception {
final Host host = new Host(new DAVProtocol(), "winbuild.iterate.ch", new Credentials(System.getProperties().getProperty("webdav.iis.user"), System.getProperties().getProperty("webdav.iis.password")));
host.setDefaultPath("/WebDAV");
final DAVSession session = new DAVSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
session.close();
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class B2SessionTest method testFeatures.
@Test
public void testFeatures() {
final Host host = new Host(new B2Protocol(), "test.cyberduck.ch");
final Session session = new B2Session(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
assertNotNull(session.getFeature(AclPermission.class));
assertNotNull(session.getFeature(Directory.class));
assertNotNull(session.getFeature(Delete.class));
assertNotNull(session.getFeature(Touch.class));
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class BrickSessionTest method testLoginInterrupt.
@Test(expected = ConnectionCanceledException.class)
public void testLoginInterrupt() 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") {
@Override
public String getProperty(final String key) {
switch(key) {
case "brick.pairing.interval.ms":
return String.valueOf(100L);
case "brick.pairing.interrupt.ms":
return String.valueOf(1000L);
}
return super.getProperty(key);
}
};
final BrickSession session = new BrickSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
session.pair(host, new DisabledConnectionCallback(), new DisabledLoginCallback(), new DisabledCancelCallback(), "t", "m", new BrowserLauncher() {
@Override
public boolean open(final String url) {
return true;
}
});
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class TransferBackgroundActionTest method testResumeOnRetryWithException.
@Test
public void testResumeOnRetryWithException() {
final AtomicBoolean alert = new AtomicBoolean();
final AbstractController controller = new AbstractController() {
@Override
public void invoke(final MainAction runnable, final boolean wait) {
runnable.run();
}
};
final Host host = new Host(new TestProtocol(), "test.cyberduck.ch");
final TransferOptions options = new TransferOptions();
final TransferBackgroundAction action = new TransferBackgroundAction(controller, new DefaultSessionPool(new TestLoginConnectionService(), new DisabledX509TrustManager(), new DefaultX509KeyManager(), new DefaultVaultRegistry(new DisabledPasswordCallback()), new DisabledTranscriptListener(), host) {
@Override
public Session<?> borrow(final BackgroundActionState callback) throws BackgroundException {
throw new ConnectionRefusedException("d", new SocketException());
}
}, SessionPool.DISCONNECTED, new TransferAdapter(), new DownloadTransfer(host, Collections.singletonList(new TransferItem(new Path("/home/test", EnumSet.of(Path.Type.file)), new NullLocal("/t")))), options) {
@Override
public boolean alert(final BackgroundException failure) {
final boolean alerted = alert.get();
alert.set(true);
return !alerted;
}
};
assertFalse(alert.get());
// Connect, prepare and run
new BackgroundCallable<Boolean>(action, controller).call();
assertTrue(alert.get());
assertTrue(action.hasFailed());
// assertTrue(options.resumeRequested);
}
use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.
the class CteraSessionTest method testLoginRefreshCookie.
@Test
public void testLoginRefreshCookie() throws Exception {
final Host host = new Host(new CteraProtocol(), "mountainduck.ctera.me", new Credentials(StringUtils.EMPTY, StringUtils.EMPTY, System.getProperties().getProperty("ctera.token")));
host.setDefaultPath("/ServicesPortal/webdav");
final CteraSession session = new CteraSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
assertNotNull(session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback()));
assertTrue(session.isConnected());
assertNotNull(session.getClient());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
assertEquals("mountainduck@cterasendbox1.onmicrosoft.com", host.getCredentials().getUsername());
assertTrue(host.getCredentials().isSaved());
new DAVListService(session).list(new Path(host.getDefaultPath(), EnumSet.of(Path.Type.directory)), new DisabledListProgressListener());
session.close();
}
Aggregations