Package org.apache.jmeter.util
Class SSLManager
java.lang.Object
org.apache.jmeter.util.SSLManager
- Direct Known Subclasses:
- JsseSSLManager
The SSLManager handles the KeyStore information for JMeter. Basically, it
 handles all the logic for loading and initializing all the JSSE parameters
 and selecting the alias to authenticate against if it is available.
 SSLManager will try to automatically select the client certificate for you,
 but if it can't make a decision, it will pop open a dialog asking you for
 more information.
 
TODO? - N.B. does not currently allow the selection of a client certificate.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedProtected Constructor to remove the possibility of directly instantiating this object.
- 
Method SummaryModifier and TypeMethodDescriptionvoidconfigureKeystore(boolean preload, int startIndex, int endIndex, String clientCertAliasVarName) Configure KeystorevoidDestroy Keystorestatic SSLManagerStatic accessor for the SSLManager object.protected JmeterKeyStoreOpens and initializes the KeyStore.protected KeyStoreOpens and initializes the TrustStore.static booleanTest whether SSL is supported or not.static voidreset()Resets the SSLManager so that we can create a new one with a new keystoreabstract voidsetContext(HttpURLConnection conn) protected voidsetProvider(Provider provider) Default implementation of setting the Provider
- 
Field Details- 
JAVAX_NET_SSL_KEY_STORE- See Also:
 
- 
defaultpwHave the password available
 
- 
- 
Constructor Details- 
SSLManagerprotected SSLManager()Protected Constructor to remove the possibility of directly instantiating this object. Create the SSLContext, and wrap all the X509KeyManagers with our X509KeyManager so that we can choose our alias.
 
- 
- 
Method Details- 
resetpublic static void reset()Resets the SSLManager so that we can create a new one with a new keystore
- 
setContext
- 
setProviderDefault implementation of setting the Provider- Parameters:
- provider- the provider to use
 
- 
getKeyStoreOpens and initializes the KeyStore. If the password for the KeyStore is not set, this method will prompt you to enter it. Unfortunately, there is no PasswordEntryField available from JOptionPane.- Returns:
- the configured JmeterKeyStore
 
- 
getTrustStoreOpens and initializes the TrustStore. There are 3 possibilities:- no truststore name provided, in which case the default Java truststore should be used
- truststore name is provided, and loads OK
- truststore name is provided, but is not found or does not load OK, in which case an empty truststore is created
 - Returns:
- nullwhen Java truststore should be used. Otherwise the truststore, which may be empty if the file could not be loaded.
 
- 
getInstanceStatic accessor for the SSLManager object. The SSLManager is a singleton.- Returns:
- the singleton SSLManager
 
- 
isSSLSupportedpublic static boolean isSSLSupported()Test whether SSL is supported or not.- Returns:
- flag whether SSL is supported
 
- 
configureKeystorepublic void configureKeystore(boolean preload, int startIndex, int endIndex, String clientCertAliasVarName) Configure Keystore- Parameters:
- preload- flag whether the keystore should be opened within this method, or the opening should be delayed
- startIndex- first index to consider for a key
- endIndex- last index to consider for a key
- clientCertAliasVarName- name of the default key, if empty the first key will be used as default key
 
- 
destroyKeystorepublic void destroyKeystore()Destroy Keystore
 
-