Class WebThingServer.SSLOptions

  • Enclosing class:
    WebThingServer

    public static class WebThingServer.SSLOptions
    extends java.lang.Object
    Class 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.SSLServerSocketFactory getSocketFactory()
      Create an SSLServerSocketFactory as required by NanoHTTPD.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SSLOptions

        public SSLOptions​(java.lang.String keystorePath,
                          java.lang.String keystorePassword)
        Initialize the object.
        Parameters:
        keystorePath - Path to the Java keystore (.jks) file
        keystorePassword - 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) file
        keystorePassword - Password to open the keystore
        protocols - 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.Exception
        Create 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.