Endpoint https

SSLContext ssl = xxx;
HttpsConfigurator configurator = new HttpsConfigurator(ssl);
// 设置发布路径等
httpsServer = HttpsServer.create(new InetSocketAddress("127.0.0.1", 8080),200);
httpsServer.setHttpsConfigurator(configurator);
HttpContext httpContext = httpsServer.createContext("/test");
ExecutorService threads = Executors.newFixedThreadPool(200);
httpsServer.setExecutor(threads);
httpsServer.start();
// 发布
endPoint = Endpoint.create(new CVReceive());
endPoint.publish(httpContext);

你可能感兴趣的:(https)