public class SSLSessionStrategyFactory extends Object
SSLSessionStrategy.| Modifier and Type | Method and Description |
|---|---|
static SSLSessionStrategy |
build(String trustStore,
String trustStorePassword,
String keyStore,
String keyStorePassword,
String[] keyAliases,
String keyPassword,
String[] allowedProtocols,
String[] allowedCiphers,
boolean allowAnyHostname,
boolean trustSelfSigned)
Build an
SSLSessionStrategy. |
static SSLSessionStrategy |
buildMutual(io.apiman.common.config.options.TLSOptions optionsMap)
Convenience function parses map of options to generate
SSLSessionStrategy. |
static SSLSessionStrategy |
buildStandard(io.apiman.common.config.options.TLSOptions optionsMap)
Convenience function parses map of options to generate
SSLSessionStrategy. |
static SSLSessionStrategy |
buildUnsafe()
Do not use in production
|
public static SSLSessionStrategy buildStandard(io.apiman.common.config.options.TLSOptions optionsMap) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException
SSLSessionStrategy.
Defaults are provided for all fields:
SSLParameters.getProtocols()SSLParameters.getCipherSuites()optionsMap - map of optionsNoSuchAlgorithmException - if the selected algorithm is not available on the systemKeyManagementException - when particular cryptographic algorithm not availableKeyStoreException - problem with keystoreCertificateException - if there was a problem with the certificateIOException - if the truststore could not be found or was invalidUnrecoverableKeyException - a key in keystore cannot be recoveredbuild(String, String, String, String, String[], String, String[], String[], boolean, boolean)public static SSLSessionStrategy buildMutual(io.apiman.common.config.options.TLSOptions optionsMap) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException, UnrecoverableKeyException
SSLSessionStrategy.
Defaults are provided for some fields, others are options. ClientKeystore is required:
SSLParameters.getProtocols()SSLParameters.getCipherSuites()optionsMap - map of optionsNoSuchAlgorithmException - if the selected algorithm is not available on the systemKeyManagementException - when particular cryptographic algorithm not availableKeyStoreException - problem with keystoreCertificateException - if there was a problem with the certificateIOException - if the truststore could not be found or was invalidUnrecoverableKeyException - a key in keystore cannot be recoveredbuild(String, String, String, String, String[], String, String[], String[], boolean, boolean)public static SSLSessionStrategy build(String trustStore, String trustStorePassword, String keyStore, String keyStorePassword, String[] keyAliases, String keyPassword, String[] allowedProtocols, String[] allowedCiphers, boolean allowAnyHostname, boolean trustSelfSigned) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException, KeyManagementException, UnrecoverableKeyException
SSLSessionStrategy.trustStore - the trust storetrustStorePassword - the truststore password (if any)keyStore - the keystorekeyStorePassword - the keystore password (if any)keyAliases - the key aliases that are candidates for use (if any)keyPassword - the key password (if any)allowedProtocols - the allowed transport protocols.
Avoid specifying insecure protocolsallowedCiphers - allowed crypto ciphersuites, null to use system defaultstrustSelfSigned - true if self signed certificates can be trusted.
Use with cautionallowAnyHostname - true if any hostname can be connected to (i.e. does not need to match
certificate hostname). Do not use in productionNoSuchAlgorithmException - if the selected algorithm is not available on the systemKeyStoreException - if there was a problem with the keystoreCertificateException - if there was a problem with the certificateIOException - if the truststore could not be found or was invalidKeyManagementException - if there is a problem with keysUnrecoverableKeyException - if the key cannot be recoveredpublic static SSLSessionStrategy buildUnsafe()
Returns an SSLSessionStrategy that trusts any Certificate.
Naturally, this is vulnerable to a raft of MIITM and forgery attacks, so users should exercise extreme caution and only use it for development purposes.
Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.