Class SslContextConfigurator

java.lang.Object
org.glassfish.tyrus.client.SslContextConfigurator

public class SslContextConfigurator extends Object
Utility class, which helps to configure ssl context.

Used to configure SslEngineConfigurator, which will be passed to client via configuration properties. Example:

      SslContextConfigurator sslContextConfigurator = new SslContextConfigurator();
      sslContextConfigurator.setTrustStoreFile("...");
      sslContextConfigurator.setTrustStorePassword("...");
      sslContextConfigurator.setTrustStoreType("...");
      sslContextConfigurator.setKeyStoreFile("...");
      sslContextConfigurator.setKeyStorePassword("...");
      sslContextConfigurator.setKeyStoreType("...");
      SslEngineConfigurator sslEngineConfigurator = new SslEngineConfigurator(sslContextConfigurator, true, false,
 false);
      client.getProperties().put(ClientManager.SSL_ENGINE_CONFIGURATOR, sslEngineConfigurator);
 
Author:
Alexey Stashok, Hubert Iwaniuk, Bruno Harbulot, Marek Potociar
  • Field Details

    • TRUST_STORE_PROVIDER

      public static final String TRUST_STORE_PROVIDER
      Trust store provider name.

      The value MUST be a String representing the name of a trust store provider.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.trustStoreProvider".

      See Also:
    • KEY_STORE_PROVIDER

      public static final String KEY_STORE_PROVIDER
      Key store provider name.

      The value MUST be a String representing the name of a trust store provider.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.keyStoreProvider".

      See Also:
    • TRUST_STORE_FILE

      public static final String TRUST_STORE_FILE
      Trust store file name.

      The value MUST be a String representing the name of a trust store file.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.trustStore".

      See Also:
    • KEY_STORE_FILE

      public static final String KEY_STORE_FILE
      Key store file name.

      The value MUST be a String representing the name of a key store file.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.keyStore".

      See Also:
    • TRUST_STORE_PASSWORD

      public static final String TRUST_STORE_PASSWORD
      Trust store file password - the password used to unlock the trust store file.

      The value MUST be a String representing the trust store file password.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.trustStorePassword".

      See Also:
    • KEY_STORE_PASSWORD

      public static final String KEY_STORE_PASSWORD
      Key store file password - the password used to unlock the trust store file.

      The value MUST be a String representing the key store file password.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.keyStorePassword".

      See Also:
    • TRUST_STORE_TYPE

      public static final String TRUST_STORE_TYPE
      Trust store type (see KeyStore.getType() for more info).

      The value MUST be a String representing the trust store type name.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.trustStoreType".

      See Also:
    • KEY_STORE_TYPE

      public static final String KEY_STORE_TYPE
      Key store type (see KeyStore.getType() for more info).

      The value MUST be a String representing the key store type name.

      No default value is set.

      The name of the configuration property is "javax.net.ssl.keyStoreType".

      See Also:
    • KEY_FACTORY_MANAGER_ALGORITHM

      public static final String KEY_FACTORY_MANAGER_ALGORITHM
      Key manager factory algorithm name.

      The value MUST be a String representing the key manager factory algorithm name.

      No default value is set.

      The name of the configuration property is "ssl.KeyManagerFactory.algorithm".

      See Also:
    • TRUST_FACTORY_MANAGER_ALGORITHM

      public static final String TRUST_FACTORY_MANAGER_ALGORITHM
      Trust manager factory algorithm name.

      The value MUST be a String representing the trust manager factory algorithm name.

      No default value is set.

      The name of the configuration property is "ssl.TrustManagerFactory.algorithm".

      See Also:
    • DEFAULT_CONFIG

      public static final SslContextConfigurator DEFAULT_CONFIG
      Default SSL configuration. If you have changed any of System.getProperties() of javax.net.ssl family you should refresh this configuration by calling retrieve(java.util.Properties).
  • Constructor Details

    • SslContextConfigurator

      public SslContextConfigurator()
      Default constructor. Reads configuration properties from System.getProperties(). Calls SslContextConfigurator(boolean) with true.
    • SslContextConfigurator

      public SslContextConfigurator(boolean readSystemProperties)
      Constructor that allows you creating empty configuration.
      Parameters:
      readSystemProperties - If true populates configuration from System.getProperties(), else you have empty configuration.
  • Method Details