public class MicroEJSSLSocketFactoryFactory extends Object
The SSLSocketFactoryFactory is configured using IBM SSL properties, i.e. properties of the format "com.ibm.ssl.propertyName", e.g. "com.ibm.ssl.keyStore". The class supports multiple configurations, each configuration is identified using a name or configuration ID. The configuration ID with "null" is used as a default configuration. When a socket factory is being created for a given configuration, properties of that configuration are first picked. If a property is not defined there, then that property is looked up in the default configuration. Finally, if a property element is still not found, then the corresponding system property is inspected, i.e. javax.net.ssl.keyStore. If the system property is not set either, then the system's default value is used (if available) or an exception is thrown.
The SSLSocketFacotryFactory can be reconfigured at any time. A reconfiguration does not affect existing socket factories.
All properties share the same key space; i.e. the configuration ID is not part of the property keys.
The methods should be called in the following order:
Modifier and Type | Field and Description |
---|---|
static String |
CERT_TYPE |
static String |
TLS_VERSION_1_2 |
Constructor and Description |
---|
MicroEJSSLSocketFactoryFactory() |
Modifier and Type | Method and Description |
---|---|
void |
addCertificate(String pathToCertificate) |
void |
addCertificate(String alias,
InputStream certificateStream) |
void |
addCertificate(String alias,
String pathToCertificate) |
SSLSocketFactory |
createSocketFactory()
Returns an SSL socket factory for TLSv1.2.
|
public static String CERT_TYPE
public static String TLS_VERSION_1_2
public void addCertificate(String pathToCertificate)
public void addCertificate(String alias, InputStream certificateStream)
public SSLSocketFactory createSocketFactory() throws MqttSecurityException
MqttSecurityException