mirror of https://github.com/apache/jclouds.git
add ConnectionSpec.CLEARTEXT for DockerEngine running w/t TLS
This commit is contained in:
parent
e4477e579a
commit
26d925c2de
|
@ -12,7 +12,7 @@ If you are using `boot2docker`, notice that from version v1.3.0 the Docker daemo
|
|||
socket (--tls, or --tlsverify),
|
||||
then you need to import CA certificate into Trusted Certs:
|
||||
|
||||
` keytool -import -trustcacerts -file /Users/andrea/.boot2docker/certs/boot2docker-vm/ca.pem -alias BOOT2DOCKER -keystore $JAVA_HOME/jre/lib/security/cacerts`
|
||||
`keytool -import -trustcacerts -file /Users/andrea/.boot2docker/certs/boot2docker-vm/ca.pem -alias BOOT2DOCKER -keystore $JAVA_HOME/jre/lib/security/cacerts`
|
||||
|
||||
by default the passoword is `changeit`
|
||||
|
||||
|
|
|
@ -131,8 +131,6 @@ public class DockerTemplateOptions extends TemplateOptions implements Cloneable
|
|||
.toString();
|
||||
}
|
||||
|
||||
public static final DockerTemplateOptions NONE = new DockerTemplateOptions();
|
||||
|
||||
public DockerTemplateOptions volumes(Map<String, String> volumes) {
|
||||
this.volumes = Optional.<Map<String, String>>of(ImmutableMap.copyOf(checkNotNull(volumes, "volumes")));
|
||||
return this;
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
*/
|
||||
package org.jclouds.docker.config;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.jclouds.docker.suppliers.SSLContextWithKeysSupplier;
|
||||
import org.jclouds.http.okhttp.OkHttpClientSupplier;
|
||||
|
||||
|
@ -23,8 +26,6 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.squareup.okhttp.ConnectionSpec;
|
||||
import com.squareup.okhttp.OkHttpClient;
|
||||
import com.squareup.okhttp.TlsVersion;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@Singleton
|
||||
public class DockerOkHttpClientSupplier implements OkHttpClientSupplier {
|
||||
|
@ -39,10 +40,10 @@ public class DockerOkHttpClientSupplier implements OkHttpClientSupplier {
|
|||
@Override
|
||||
public OkHttpClient get() {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
ConnectionSpec connectionSpecs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
||||
ConnectionSpec modernTLS = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
||||
.tlsVersions(TlsVersion.TLS_1_0, TlsVersion.TLS_1_1, TlsVersion.TLS_1_2)
|
||||
.build();
|
||||
client.setConnectionSpecs(ImmutableList.of(connectionSpecs));
|
||||
client.setConnectionSpecs(ImmutableList.of(modernTLS, ConnectionSpec.CLEARTEXT));
|
||||
client.setSslSocketFactory(sslContextWithKeysSupplier.get().getSocketFactory());
|
||||
return client;
|
||||
}
|
||||
|
|
|
@ -16,41 +16,32 @@
|
|||
*/
|
||||
package org.jclouds.docker.features;
|
||||
|
||||
import org.jclouds.docker.compute.BaseDockerApiLiveTest;
|
||||
import org.jclouds.docker.options.BuildOptions;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.jclouds.docker.compute.BaseDockerApiLiveTest;
|
||||
import org.jclouds.docker.options.BuildOptions;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
@Test(groups = "live", testName = "MiscApiLiveTest", singleThreaded = true)
|
||||
public class MiscApiLiveTest extends BaseDockerApiLiveTest {
|
||||
|
||||
private static final String API_VERSION = "1.16";
|
||||
private static final String VERSION = "1.4.1";
|
||||
private static final String GIT_COMMIT = "5bc2ff8";
|
||||
private static final String GO_VERSION = "go1.3.3";
|
||||
private static final String KERNEL_VERSION = "3.16.7-tinycore64";
|
||||
private static final String ARCH = "amd64";
|
||||
private static final String OS = "linux";
|
||||
|
||||
private static String imageId;
|
||||
|
||||
@Test
|
||||
public void testVersion() {
|
||||
assertEquals(api().getVersion().apiVersion(), API_VERSION);
|
||||
assertEquals(api().getVersion().version(), VERSION);
|
||||
assertEquals(api().getVersion().gitCommit(), GIT_COMMIT);
|
||||
assertEquals(api().getVersion().goVersion(), GO_VERSION);
|
||||
assertEquals(api().getVersion().kernelVersion(), KERNEL_VERSION);
|
||||
assertEquals(api().getVersion().arch(), ARCH);
|
||||
assertEquals(api().getVersion().os(), OS);
|
||||
assertNotNull(api().getVersion().apiVersion());
|
||||
assertNotNull(api().getVersion().version());
|
||||
assertNotNull(api().getVersion().gitCommit());
|
||||
assertNotNull(api().getVersion().goVersion());
|
||||
assertNotNull(api().getVersion().kernelVersion());
|
||||
assertNotNull(api().getVersion().arch());
|
||||
assertNotNull(api().getVersion().os());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue