- java.lang.Object
- 
- com.sun.net.httpserver.HttpServer
- 
- com.sun.net.httpserver.HttpsServer
 
 
- 
 public abstract class HttpsServer extends HttpServer This class is an extension ofHttpServerwhich provides support for HTTPS.A HttpsServer must have an associated HttpsConfiguratorobject which is used to establish the SSL configuration for the SSL connections.All other configuration is the same as for HttpServer. - Since:
- 1.6
 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedHttpsServer()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static HttpsServercreate()creates a HttpsServer instance which is initially not bound to any local address/port.static HttpsServercreate(InetSocketAddress addr, int backlog)Create aHttpsServerinstance which will bind to the specifiedInetSocketAddress(IP address and port number) A maximum backlog can also be specified.abstract HttpsConfiguratorgetHttpsConfigurator()Gets this server'sHttpsConfiguratorobject, if it has been set.abstract voidsetHttpsConfigurator(HttpsConfigurator config)Sets this server'sHttpsConfiguratorobject.- 
Methods declared in class com.sun.net.httpserver.HttpServerbind, createContext, createContext, getAddress, getExecutor, removeContext, removeContext, setExecutor, start, stop
 
- 
 
- 
- 
- 
Method Detail- 
createpublic static HttpsServer create() throws IOException creates a HttpsServer instance which is initially not bound to any local address/port. The HttpsServer is acquired from the currently installedHttpServerProviderThe server must be bound usingHttpServer.bind(InetSocketAddress,int)before it can be used. The server must also have a HttpsConfigurator established withsetHttpsConfigurator(HttpsConfigurator)- Throws:
- IOException
 
 - 
createpublic static HttpsServer create(InetSocketAddress addr, int backlog) throws IOException Create aHttpsServerinstance which will bind to the specifiedInetSocketAddress(IP address and port number) A maximum backlog can also be specified. This is the maximum number of queued incoming connections to allow on the listening socket. Queued TCP connections exceeding this limit may be rejected by the TCP implementation. The HttpsServer is acquired from the currently installedHttpServerProviderThe server must have a HttpsConfigurator established withsetHttpsConfigurator(HttpsConfigurator)- Parameters:
- addr- the address to listen on, if- nullthen bind() must be called to set the address
- backlog- the socket backlog. If this value is less than or equal to zero, then a system default value is used.
- Throws:
- BindException- if the server cannot bind to the requested address, or if the server is already bound.
- IOException
 
 - 
setHttpsConfiguratorpublic abstract void setHttpsConfigurator(HttpsConfigurator config) Sets this server'sHttpsConfiguratorobject.- Parameters:
- config- the HttpsConfigurator to set
- Throws:
- NullPointerException- if config is null.
 
 - 
getHttpsConfiguratorpublic abstract HttpsConfigurator getHttpsConfigurator() Gets this server'sHttpsConfiguratorobject, if it has been set.- Returns:
- the HttpsConfigurator for this server, or nullif not set.
 
 
- 
 
-