HttpsServer. Applications need to override
the configure(HttpsParameters) method in order to change
the default configuration.
The following example shows how this may be done:
SSLContext sslContext = SSLContext.getInstance(....);
HttpsServer server = HttpsServer.create();
server.setHttpsConfigurator(new HttpsConfigurator(sslContext) {
public void configure(HttpsParameters params) {
// get the remote address if needed
InetSocketAddress remote = params.getClientAddress();
SSLContext c = getSSLContext();
// get the default parameters
SSLParameters sslparams = c.getDefaultSSLParameters();
if (remote.equals(...)) {
// modify the default set for client x
}
params.setSSLParameters(sslparams);
}
});
| Modifier and Type | Field and Description |
|---|---|
| private SSLContext |
| Access | Constructor and Description |
|---|---|
| public | HttpsConfigurator(SSLContext
the context)SSLContext to use for this configuratorCreates a Https configuration, with the given |
| Modifier and Type | Method and Description |
|---|---|
| public void | configure(HttpsParameters
the params)HttpsParameters to be configuredCalled by the |
| public SSLContext |
| context | back to summary |
|---|---|
| private SSLContext context | |
| HttpsConfigurator | back to summary |
|---|---|
| public HttpsConfigurator(SSLContext context) Creates a Https configuration, with the given
| |
| configure | back to summary |
|---|---|
| public void configure(HttpsParameters params) Called by the The default implementation of this method uses the SSLParameters returned from: configure() may be overridden in order to modify this behavior. See example above.
| |
| getSSLContext | back to summary |
|---|---|
| public SSLContext getSSLContext() Returns the
| |