Search in sources :

Example 96 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class CloudFrontDistributionConfigurationTest method testGetMethods.

@Test
public void testGetMethods() {
    final S3Session session = new S3Session(new Host(new S3Protocol(), new S3Protocol().getDefaultHostname()));
    assertEquals(Arrays.asList(Distribution.DOWNLOAD, Distribution.STREAMING), new CloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager()).getMethods(new Path("/bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))));
}
Also used : Path(ch.cyberduck.core.Path) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) S3Session(ch.cyberduck.core.s3.S3Session) Host(ch.cyberduck.core.Host) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) S3Protocol(ch.cyberduck.core.s3.S3Protocol) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 97 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class CloudFrontDistributionConfigurationTest method testReadStreaming.

@Test
public void testReadStreaming() throws Exception {
    final DistributionConfiguration configuration = new CloudFrontDistributionConfiguration(session, new DisabledX509TrustManager(), new DefaultX509KeyManager());
    final Path container = new Path("test-us-east-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
    final Distribution distribution = configuration.read(container, Distribution.STREAMING, new DisabledLoginCallback());
    assertEquals("E25267XDMTRRIW", distribution.getId());
    assertEquals("test-us-east-1-cyberduck.s3.amazonaws.com", distribution.getOrigin().getHost());
    assertEquals(URI.create("rtmp://s9xwj9xzlfydi.cloudfront.net/cfx/st"), distribution.getUrl());
    assertNull(distribution.getIndexDocument());
    assertNull(distribution.getErrorDocument());
    assertEquals("Amazon CloudFront", distribution.getName());
}
Also used : Path(ch.cyberduck.core.Path) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) Distribution(ch.cyberduck.core.cdn.Distribution) StreamingDistribution(com.amazonaws.services.cloudfront.model.StreamingDistribution) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) DistributionConfiguration(ch.cyberduck.core.cdn.DistributionConfiguration) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) AbstractS3Test(ch.cyberduck.core.s3.AbstractS3Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 98 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class CustomOriginCloudFrontDistributionConfigurationTest method testGetOriginCustomHttpsPort.

@Test
public void testGetOriginCustomHttpsPort() {
    final Host origin = new Host(new TestProtocol(), "m");
    final Path container = new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume));
    origin.setWebURL("https://w.example.net:4444");
    final CustomOriginCloudFrontDistributionConfiguration configuration = new CustomOriginCloudFrontDistributionConfiguration(origin, new DefaultX509TrustManager(), new DefaultX509KeyManager());
    assertEquals("w.example.net", configuration.getOrigin(container, Distribution.CUSTOM).getHost());
    assertEquals("https", configuration.getOrigin(container, Distribution.CUSTOM).getScheme());
    assertEquals(4444, configuration.getOrigin(container, Distribution.CUSTOM).getPort());
    origin.setWebURL(null);
    assertEquals("m", configuration.getOrigin(container, Distribution.CUSTOM).getHost());
    assertEquals(-1, configuration.getOrigin(container, Distribution.CUSTOM).getPort());
}
Also used : Path(ch.cyberduck.core.Path) TestProtocol(ch.cyberduck.core.TestProtocol) Host(ch.cyberduck.core.Host) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) DefaultX509TrustManager(ch.cyberduck.core.ssl.DefaultX509TrustManager) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 99 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class CustomOriginCloudFrontDistributionConfigurationTest method testGetOrigin.

@Test
public void testGetOrigin() {
    final Host origin = new Host(new TestProtocol(), "m");
    final Path container = new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume));
    origin.setWebURL("http://w.example.net");
    final CustomOriginCloudFrontDistributionConfiguration configuration = new CustomOriginCloudFrontDistributionConfiguration(origin, new DefaultX509TrustManager(), new DefaultX509KeyManager());
    assertEquals("w.example.net", configuration.getOrigin(container, Distribution.CUSTOM).getHost());
    origin.setWebURL(null);
    assertEquals("m", configuration.getOrigin(container, Distribution.CUSTOM).getHost());
    origin.setWebURL("f");
    assertEquals("f", configuration.getOrigin(container, Distribution.CUSTOM).getHost());
}
Also used : Path(ch.cyberduck.core.Path) TestProtocol(ch.cyberduck.core.TestProtocol) Host(ch.cyberduck.core.Host) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) DefaultX509TrustManager(ch.cyberduck.core.ssl.DefaultX509TrustManager) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 100 with DefaultX509KeyManager

use of ch.cyberduck.core.ssl.DefaultX509KeyManager in project cyberduck by iterate-ch.

the class CustomOriginCloudFrontDistributionConfigurationTest method testReadNoConfiguredDistributionForOrigin.

@Test
public void testReadNoConfiguredDistributionForOrigin() throws Exception {
    final Host origin = new Host(new TestProtocol(), "myhost.localdomain");
    origin.getCdnCredentials().setUsername(System.getProperties().getProperty("s3.key"));
    origin.getCdnCredentials().setPassword(System.getProperties().getProperty("s3.secret"));
    final CustomOriginCloudFrontDistributionConfiguration configuration = new CustomOriginCloudFrontDistributionConfiguration(origin, new DefaultX509TrustManager() {

        @Override
        public void checkServerTrusted(final X509Certificate[] certs, final String cipher) {
        // 
        }
    }, new DefaultX509KeyManager());
    final Path container = new Path("unknown.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume));
    final Distribution distribution = configuration.read(container, Distribution.CUSTOM, new DisabledLoginCallback() {

        @Override
        public Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options) {
            return new Credentials(System.getProperties().getProperty("s3.key"), System.getProperties().getProperty("s3.secret"));
        }
    });
    assertFalse(distribution.isEnabled());
    assertEquals("Amazon CloudFront", distribution.getName());
}
Also used : Path(ch.cyberduck.core.Path) TestProtocol(ch.cyberduck.core.TestProtocol) Host(ch.cyberduck.core.Host) X509Certificate(java.security.cert.X509Certificate) LoginOptions(ch.cyberduck.core.LoginOptions) Distribution(ch.cyberduck.core.cdn.Distribution) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) Credentials(ch.cyberduck.core.Credentials) DefaultX509TrustManager(ch.cyberduck.core.ssl.DefaultX509TrustManager) 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