managedServer = serverFactory.newServer(networkConfig);
// add secure endpoint if configured
int securePort = networkConfig.getInt(NetworkConfigDefaults.PROPERTY_DEFAULT_COAPS_PORT);
if ( securePort > 0 ) {
Endpoint secureEndpoint = endpointFactory.getSecureEndpoint(
networkConfig, new InetSocketAddress((InetAddress) null, securePort));
if (secureEndpoint != null) {
LOGGER.fine("Adding secure endpoint on address " + secureEndpoint.getAddress());
managedServer.addEndpoint(secureEndpoint);
} else {
LOGGER.warning("Secure endpoint has been configured in server properties but EndpointFactory does not support creation of secure Endpoints");
}