Examples of HttpsConfigurator


Examples of com.sun.net.httpserver.HttpsConfigurator

      throw new RuntimeException("Could not set up SSL context", e);
    }
  }

  private HttpsConfigurator getConfigurator(final SSLContext sslContext) {
    return new HttpsConfigurator(sslContext) {
          @Override
          public void configure (HttpsParameters params) {
            final SSLContext context = getSSLContext();
            final SSLParameters sslParams = context.getDefaultSSLParameters();
            params.setNeedClientAuth(false);
View Full Code Here

Examples of com.sun.net.httpserver.HttpsConfigurator

     * Https Server
     */
    public void startHttpsServer() throws IOException, NoSuchAlgorithmException  {
        httpsServer = com.sun.net.httpserver.HttpsServer.create(new InetSocketAddress(0), 0);
        httpsServer.createContext("/", new MyHandler());
        httpsServer.setHttpsConfigurator(new HttpsConfigurator(SSLContext.getDefault()));
        httpsServer.start();
    }
View Full Code Here

Examples of com.sun.net.httpserver.HttpsConfigurator

     * Https Server
     */
    public void startHttpsServer() throws IOException, NoSuchAlgorithmException  {
        httpsServer = com.sun.net.httpserver.HttpsServer.create(new InetSocketAddress(0), 0);
        httpsServer.createContext("/test6614957/", new MyHandler());
        httpsServer.setHttpsConfigurator(new HttpsConfigurator(SSLContext.getDefault()));
        httpsServer.start();
    }
View Full Code Here

Examples of com.sun.net.httpserver.HttpsConfigurator

      //Create the SSL context with keystore & truststore
      SSLContext ssl = SSLContext.getInstance("TLS");
      ssl.init(keyFactory.getKeyManagers(), trustFactory.getTrustManagers(), new SecureRandom());

      HttpsServer httpsServer = HttpsServer.create(new InetSocketAddress(HOSTNAME, 8443), 10);
      httpsServer.setHttpsConfigurator(new HttpsConfigurator(ssl) {

        public void configure(HttpsParameters params) {

          //require client authentication
          SSLParameters sslparams = getSSLContext().getDefaultSSLParameters();
View Full Code Here

Examples of com.sun.net.httpserver.HttpsConfigurator

            //TrustManagerFactory tmf = TrustManagerFactory.getInstance ( TrustManagerFactory.getDefaultAlgorithm() );
            //tmf.init ( ks );
   
            // setup the HTTPS context and parameters
            sslContext.init ( kmf.getKeyManagers (), new TrustManager[]{trustManager}, null );
            httpsServer.setHttpsConfiguratornew HttpsConfigurator( sslContext )
            {
                public void configure ( HttpsParameters params )
                {
                    try
                    {
View Full Code Here

Examples of com.sun.net.httpserver.HttpsConfigurator

            TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
            tmf.init(keyStore);
            SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
            sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom());
            HttpsServer server = HttpsServer.create(new InetSocketAddress(portFlag.value(options)), 0);
            server.setHttpsConfigurator(new HttpsConfigurator(sslContext));
            return server;
        } else {
            return HttpServer.create(new InetSocketAddress(portFlag.value(options)), 0);
        }
    }
View Full Code Here

Examples of org.jboss.com.sun.net.httpserver.HttpsConfigurator

        this.chan= chan;
        InetSocketAddress addr =
                (InetSocketAddress)chan.socket().getRemoteSocketAddress();
        engine = sslctx.createSSLEngine (addr.getHostName(), addr.getPort());
        engine.setUseClientMode (false);
        HttpsConfigurator cfg = server.getHttpsConfigurator();
        configureEngine (cfg, addr);
        wrapper = new EngineWrapper (chan, engine);
    }
View Full Code Here

Examples of org.jboss.com.sun.net.httpserver.HttpsConfigurator

        HttpsServer secureHttpServer = null;
        if (secureBindAddress != null) {
            secureHttpServer = HttpsServer.create(secureBindAddress, backlog, configuration);
            final SSLContext context = securityRealm.getSSLContext();
            if (context != null) {
                secureHttpServer.setHttpsConfigurator(new HttpsConfigurator(context) {

                    @Override
                    public void configure(HttpsParameters params) {
                        SSLParameters sslparams = context.getDefaultSSLParameters();
View Full Code Here

Examples of org.jboss.com.sun.net.httpserver.HttpsConfigurator

        HttpsServer secureHttpServer = null;
        if (secureBindAddress != null) {
            secureHttpServer = HttpsServer.create(secureBindAddress, backlog, configuration);
            final SSLContext context = securityRealm.getSSLContext();
            if (context != null) {
                secureHttpServer.setHttpsConfigurator(new HttpsConfigurator(context) {

                    @Override
                    public void configure(HttpsParameters params) {
                        SSLParameters sslparams = context.getDefaultSSLParameters();
View Full Code Here

Examples of org.jboss.com.sun.net.httpserver.HttpsConfigurator

        this.chan= chan;
        InetSocketAddress addr =
                (InetSocketAddress)chan.socket().getRemoteSocketAddress();
        engine = sslctx.createSSLEngine (addr.getHostName(), addr.getPort());
        engine.setUseClientMode (false);
        HttpsConfigurator cfg = server.getHttpsConfigurator();
        configureEngine (cfg, addr);
        wrapper = new EngineWrapper (chan, engine);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.