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))));
}
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());
}
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());
}
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());
}
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());
}
Aggregations