Package com.gears42.iot.webthing
Class WebThingServer.SSLOptions
- java.lang.Object
-
- com.gears42.iot.webthing.WebThingServer.SSLOptions
-
- Enclosing class:
- WebThingServer
public static class WebThingServer.SSLOptions extends java.lang.ObjectClass to hold options required by SSL server.
-
-
Constructor Summary
Constructors Constructor Description SSLOptions(java.lang.String keystorePath, java.lang.String keystorePassword)Initialize the object.SSLOptions(java.lang.String keystorePath, java.lang.String keystorePassword, java.lang.String[] protocols)Initialize the object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getProtocols()Get the list of enabled protocols.javax.net.ssl.SSLServerSocketFactorygetSocketFactory()Create an SSLServerSocketFactory as required by NanoHTTPD.
-
-
-
Constructor Detail
-
SSLOptions
public SSLOptions(java.lang.String keystorePath, java.lang.String keystorePassword)Initialize the object.- Parameters:
keystorePath- Path to the Java keystore (.jks) filekeystorePassword- Password to open the keystore
-
SSLOptions
public SSLOptions(java.lang.String keystorePath, java.lang.String keystorePassword, java.lang.String[] protocols)Initialize the object.- Parameters:
keystorePath- Path to the Java keystore (.jks) filekeystorePassword- Password to open the keystoreprotocols- List of protocols to enable. Documentation found here: https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SSLServerSocket.html#setEnabledProtocols-java.lang.String:A-
-
-
Method Detail
-
getSocketFactory
public javax.net.ssl.SSLServerSocketFactory getSocketFactory() throws java.lang.ExceptionCreate an SSLServerSocketFactory as required by NanoHTTPD.- Returns:
- The socket factory.
- Throws:
java.io.IOException- If server fails to bind.java.lang.Exception
-
getProtocols
public java.lang.String[] getProtocols()
Get the list of enabled protocols.- Returns:
- The list of protocols.
-
-