List of usage examples for com.squareup.okhttp TlsVersion TLS_1_0
TlsVersion TLS_1_0
To view the source code for com.squareup.okhttp TlsVersion TLS_1_0.
Click Source Link
From source file:io.macgyver.plugin.elb.a10.A10ClientImpl.java
License:Apache License
/** * The A10 control port has a brain-dead HTTPS stack that is unable to * negotiate TLS versions./*from www . j a v a2 s .co m*/ * * @return */ List<ConnectionSpec> getA10CompatibleConnectionSpecs() { List<ConnectionSpec> list = Lists.newArrayList(); list.add(new Builder(ConnectionSpec.MODERN_TLS).tlsVersions(TlsVersion.TLS_1_0).build()); // This // is // essential list.add(ConnectionSpec.MODERN_TLS); list.add(ConnectionSpec.CLEARTEXT); return ImmutableList.copyOf(list); }
From source file:org.jclouds.docker.config.DockerOkHttpClientSupplier.java
License:Apache License
@Override public OkHttpClient get() { OkHttpClient client = new OkHttpClient(); ConnectionSpec tlsSpec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) .tlsVersions(TlsVersion.TLS_1_0, TlsVersion.TLS_1_1, TlsVersion.TLS_1_2).build(); ConnectionSpec cleartextSpec = new ConnectionSpec.Builder(ConnectionSpec.CLEARTEXT).build(); client.setConnectionSpecs(ImmutableList.of(tlsSpec, cleartextSpec)); // check if identity and credential are files, to set up sslContext if (new File(creds.get().identity).isFile() && new File(creds.get().credential).isFile()) { client.setSslSocketFactory(dockerSSLContextSupplier.get().getSocketFactory()); }/*from w w w . ja v a 2 s. c om*/ return client; }