org.glassfish.jersey.client
Class SslConfig

java.lang.Object
  extended by org.glassfish.jersey.client.SslConfig

public class SslConfig
extends java.lang.Object

SSL configuration for HTTPS connections.

An instance of this class may be added as a property of the ClientConfig using ClientProperties.SSL_CONFIG.

Author:
Pavel Bucek (pavel.bucek at oracle.com), Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
SslConfig()
          Create SSL configuration with no HostnameVerifier and a default SSLContext constructed using SSLContext.getInstance("SSL").
SslConfig(javax.net.ssl.HostnameVerifier verifier)
          Create SSL configuration with a HostnameVerifier and a default SSLContext constructed using SSLContext.getInstance("SSL").
SslConfig(javax.net.ssl.HostnameVerifier verifier, javax.net.ssl.SSLContext context)
          Create SSL configuration with a HostnameVerifier and a SSLContext.
SslConfig(javax.net.ssl.SSLContext context)
          Create SSL configuration with no HostnameVerifier and a specified SSLContext.
 
Method Summary
 javax.net.ssl.HostnameVerifier getHostnameVerifier()
          Get the hostname verifier.
 javax.net.ssl.SSLContext getSSLContext()
          Get the SSLContext.
 boolean isHostnameVerifierSet()
          Check if a hostname verifier is configured in this SSL config.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SslConfig

public SslConfig()
          throws java.security.NoSuchAlgorithmException
Create SSL configuration with no HostnameVerifier and a default SSLContext constructed using SSLContext.getInstance("SSL").

Throws:
java.security.NoSuchAlgorithmException - if the SSLContext could not be created.

SslConfig

public SslConfig(javax.net.ssl.HostnameVerifier verifier)
          throws java.security.NoSuchAlgorithmException
Create SSL configuration with a HostnameVerifier and a default SSLContext constructed using SSLContext.getInstance("SSL").

Parameters:
verifier - the HostnameVerifier.
Throws:
java.security.NoSuchAlgorithmException - if the SSLContext could not be created.

SslConfig

public SslConfig(javax.net.ssl.HostnameVerifier verifier,
                 javax.net.ssl.SSLContext context)
Create SSL configuration with a HostnameVerifier and a SSLContext.

Parameters:
verifier - the hostname verifier.
context - the SSL context. Must not be null.

SslConfig

public SslConfig(javax.net.ssl.SSLContext context)
Create SSL configuration with no HostnameVerifier and a specified SSLContext.

Parameters:
context - the SSL context. Must not be null.
Method Detail

isHostnameVerifierSet

public boolean isHostnameVerifierSet()
Check if a hostname verifier is configured in this SSL config.

Returns:
true if a hostname verifier is configured, false otherwise.

getHostnameVerifier

public javax.net.ssl.HostnameVerifier getHostnameVerifier()
Get the hostname verifier.

Returns:
the configured hostname verifier, or null if not set.

getSSLContext

public javax.net.ssl.SSLContext getSSLContext()
Get the SSLContext.

Returns:
the SSL context. Is never null.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.