Search in sources :

Example 56 with DefaultX509KeyManager

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();
}
Also used : DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 57 with DefaultX509KeyManager

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));
}
Also used : Delete(ch.cyberduck.core.features.Delete) AclPermission(ch.cyberduck.core.features.AclPermission) Host(ch.cyberduck.core.Host) Touch(ch.cyberduck.core.features.Touch) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) Session(ch.cyberduck.core.Session) DefaultX509TrustManager(ch.cyberduck.core.ssl.DefaultX509TrustManager) Directory(ch.cyberduck.core.features.Directory) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 58 with DefaultX509KeyManager

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;
        }
    });
}
Also used : BrowserLauncher(ch.cyberduck.core.local.BrowserLauncher) Host(ch.cyberduck.core.Host) ProfilePlistReader(ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader) Profile(ch.cyberduck.core.Profile) ProtocolFactory(ch.cyberduck.core.ProtocolFactory) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) DefaultX509TrustManager(ch.cyberduck.core.ssl.DefaultX509TrustManager) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 59 with DefaultX509KeyManager

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);
}
Also used : SocketException(java.net.SocketException) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) TestProtocol(ch.cyberduck.core.TestProtocol) DefaultSessionPool(ch.cyberduck.core.pool.DefaultSessionPool) ConnectionRefusedException(ch.cyberduck.core.exception.ConnectionRefusedException) TransferOptions(ch.cyberduck.core.transfer.TransferOptions) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DownloadTransfer(ch.cyberduck.core.transfer.DownloadTransfer) NullLocal(ch.cyberduck.core.NullLocal) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Path(ch.cyberduck.core.Path) TransferAdapter(ch.cyberduck.core.transfer.TransferAdapter) Host(ch.cyberduck.core.Host) AbstractController(ch.cyberduck.core.AbstractController) DisabledTranscriptListener(ch.cyberduck.core.DisabledTranscriptListener) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestLoginConnectionService(ch.cyberduck.core.TestLoginConnectionService) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) TransferItem(ch.cyberduck.core.transfer.TransferItem) BackgroundException(ch.cyberduck.core.exception.BackgroundException) NullSession(ch.cyberduck.core.NullSession) Session(ch.cyberduck.core.Session) NullTransferSession(ch.cyberduck.core.NullTransferSession) Test(org.junit.Test)

Example 60 with DefaultX509KeyManager

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();
}
Also used : Path(ch.cyberduck.core.Path) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) DisabledListProgressListener(ch.cyberduck.core.DisabledListProgressListener) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) Host(ch.cyberduck.core.Host) DAVListService(ch.cyberduck.core.dav.DAVListService) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) Credentials(ch.cyberduck.core.Credentials) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

DefaultX509KeyManager (ch.cyberduck.core.ssl.DefaultX509KeyManager)176 Test (org.junit.Test)155 DisabledX509TrustManager (ch.cyberduck.core.ssl.DisabledX509TrustManager)145 Host (ch.cyberduck.core.Host)136 IntegrationTest (ch.cyberduck.test.IntegrationTest)124 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)111 Credentials (ch.cyberduck.core.Credentials)103 DisabledCancelCallback (ch.cyberduck.core.DisabledCancelCallback)99 DisabledHostKeyCallback (ch.cyberduck.core.DisabledHostKeyCallback)97 Path (ch.cyberduck.core.Path)86 Scheme (ch.cyberduck.core.Scheme)51 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)45 Delete (ch.cyberduck.core.features.Delete)40 DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)36 LoginOptions (ch.cyberduck.core.LoginOptions)31 LoginConnectionService (ch.cyberduck.core.LoginConnectionService)30 ProfilePlistReader (ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader)30 DefaultX509TrustManager (ch.cyberduck.core.ssl.DefaultX509TrustManager)30 TransferItem (ch.cyberduck.core.transfer.TransferItem)27 DisabledPasswordStore (ch.cyberduck.core.DisabledPasswordStore)26