Camel case names
This commit is contained in:
parent
1e164edc4f
commit
f78ec699ab
|
@ -229,9 +229,9 @@ public class TestSSLSocketFactory {
|
|||
|
||||
final HttpContext context = new BasicHttpContext();
|
||||
// Use default SSL context
|
||||
final SSLContext defaultsslcontext = SSLContexts.createDefault();
|
||||
final SSLContext defaultSslContext = SSLContexts.createDefault();
|
||||
|
||||
final SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(defaultsslcontext,
|
||||
final SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(defaultSslContext,
|
||||
NoopHostnameVerifier.INSTANCE);
|
||||
|
||||
try (final Socket socket = socketFactory.createSocket(context)) {
|
||||
|
@ -274,11 +274,11 @@ public class TestSSLSocketFactory {
|
|||
final HttpContext context = new BasicHttpContext();
|
||||
|
||||
// @formatter:off
|
||||
final SSLContext sslcontext = SSLContexts.custom()
|
||||
final SSLContext sslContext = SSLContexts.custom()
|
||||
.loadTrustMaterial(null, trustStrategy)
|
||||
.build();
|
||||
// @formatter:on
|
||||
final SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslcontext,
|
||||
final SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext,
|
||||
NoopHostnameVerifier.INSTANCE);
|
||||
|
||||
try (final Socket socket = socketFactory.createSocket(context)) {
|
||||
|
|
|
@ -76,13 +76,13 @@ public class ConscryptClientTlsStrategy extends AbstractClientTlsStrategy {
|
|||
}
|
||||
|
||||
public ConscryptClientTlsStrategy(
|
||||
final SSLContext sslcontext,
|
||||
final SSLContext sslContext,
|
||||
final HostnameVerifier hostnameVerifier) {
|
||||
this(sslcontext, null, null, SSLBufferMode.STATIC, hostnameVerifier);
|
||||
this(sslContext, null, null, SSLBufferMode.STATIC, hostnameVerifier);
|
||||
}
|
||||
|
||||
public ConscryptClientTlsStrategy(final SSLContext sslcontext) {
|
||||
this(sslcontext, HttpsSupport.getDefaultHostnameVerifier());
|
||||
public ConscryptClientTlsStrategy(final SSLContext sslContext) {
|
||||
this(sslContext, HttpsSupport.getDefaultHostnameVerifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -94,13 +94,13 @@ public class DefaultClientTlsStrategy extends AbstractClientTlsStrategy {
|
|||
}
|
||||
|
||||
public DefaultClientTlsStrategy(
|
||||
final SSLContext sslcontext,
|
||||
final SSLContext sslContext,
|
||||
final HostnameVerifier hostnameVerifier) {
|
||||
this(sslcontext, null, null, SSLBufferMode.STATIC, hostnameVerifier);
|
||||
this(sslContext, null, null, SSLBufferMode.STATIC, hostnameVerifier);
|
||||
}
|
||||
|
||||
public DefaultClientTlsStrategy(final SSLContext sslcontext) {
|
||||
this(sslcontext, HttpsSupport.getDefaultHostnameVerifier());
|
||||
public DefaultClientTlsStrategy(final SSLContext sslContext) {
|
||||
this(sslContext, HttpsSupport.getDefaultHostnameVerifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,14 +58,14 @@ public class AsyncClientCustomSSL {
|
|||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
// Trust standard CA and those trusted by our custom strategy
|
||||
final SSLContext sslcontext = SSLContexts.custom()
|
||||
final SSLContext sslContext = SSLContexts.custom()
|
||||
.loadTrustMaterial((chain, authType) -> {
|
||||
final X509Certificate cert = chain[0];
|
||||
return "CN=httpbin.org".equalsIgnoreCase(cert.getSubjectDN().getName());
|
||||
})
|
||||
.build();
|
||||
final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create()
|
||||
.setSslContext(sslcontext)
|
||||
.setSslContext(sslContext)
|
||||
.build();
|
||||
|
||||
final PoolingAsyncClientConnectionManager cm = PoolingAsyncClientConnectionManagerBuilder.create()
|
||||
|
|
|
@ -148,13 +148,13 @@ public class ClientConfiguration {
|
|||
|
||||
// SSL context for secure connections can be created either based on
|
||||
// system or application specific properties.
|
||||
final SSLContext sslcontext = SSLContexts.createSystemDefault();
|
||||
final SSLContext sslContext = SSLContexts.createSystemDefault();
|
||||
|
||||
// Create a registry of custom connection socket factories for supported
|
||||
// protocol schemes.
|
||||
final Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("http", PlainConnectionSocketFactory.INSTANCE)
|
||||
.register("https", new SSLConnectionSocketFactory(sslcontext))
|
||||
.register("https", new SSLConnectionSocketFactory(sslContext))
|
||||
.build();
|
||||
|
||||
// Use custom DNS resolver to override the system DNS resolution.
|
||||
|
|
|
@ -54,14 +54,14 @@ public class ClientCustomSSL {
|
|||
|
||||
public final static void main(final String[] args) throws Exception {
|
||||
// Trust standard CA and those trusted by our custom strategy
|
||||
final SSLContext sslcontext = SSLContexts.custom()
|
||||
final SSLContext sslContext = SSLContexts.custom()
|
||||
.loadTrustMaterial((chain, authType) -> {
|
||||
final X509Certificate cert = chain[0];
|
||||
return "CN=httpbin.org".equalsIgnoreCase(cert.getSubjectDN().getName());
|
||||
})
|
||||
.build();
|
||||
final SSLConnectionSocketFactory sslSocketFactory = SSLConnectionSocketFactoryBuilder.create()
|
||||
.setSslContext(sslcontext)
|
||||
.setSslContext(sslContext)
|
||||
.build();
|
||||
// Allow TLSv1.3 protocol only
|
||||
final HttpClientConnectionManager cm = PoolingHttpClientConnectionManagerBuilder.create()
|
||||
|
|
Loading…
Reference in New Issue