Package com.sun.net.httpserver

Examples of 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


    }
   
    public HttpServer createHttpServerInstance(int port) throws IOException {
        try {
            HttpsServer server = HttpsServer.create(new InetSocketAddress(port), 5);
            server.setHttpsConfigurator (new HttpsConfigurator(sslContext) {
                @Override
                public void configure (HttpsParameters params) {

                // get the remote address if needed
                InetSocketAddress remote = params.getClientAddress();
View Full Code Here

    TrustManager[] trustManagers = tmf.getTrustManagers();

    ssl.init(keyManagers, trustManagers, new SecureRandom());

    //Init a configuration with our SSL context
    HttpsConfigurator configurator = new HttpsConfigurator(ssl);

    //Create a server on localhost, port 443 (https port)
    httpsServer = HttpsServer.create(new InetSocketAddress("localhost", port), port);
    httpsServer.setHttpsConfigurator(configurator);
   
View Full Code Here

        server = HttpsServer.create(new InetSocketAddress(port), 0);
      } else {
        server = HttpsServer.create(new InetSocketAddress(host, port), 0);
      }
      final SSLContext sslContext = getSslContext(config.getKeystore(), config.getKeyStorePassword());
      final HttpsConfigurator configurator = getConfigurator(sslContext);
      ((HttpsServer)server).setHttpsConfigurator(configurator);
      final RequestLimiter limiter = getRequestLimiterOrNull(config);
      final LanguageToolHttpHandler httpHandler = new LanguageToolHttpHandler(config.isVerbose(), allowedIps, runInternally, limiter);
      httpHandler.setMaxTextLength(config.getMaxTextLength());
      httpHandler.setAllowOriginUrl(config.getAllowOriginUrl());
View Full Code Here

      keyStoreStream.close();
    }
  }

  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

    @Override
    public HttpServer createHttpServerInstance(int port) throws IOException {
        try {
            HttpsServer server = HttpsServer.create(new InetSocketAddress(port), 5);
            server.setHttpsConfigurator(new HttpsConfigurator(sslContext) {
                @Override
                public void configure(HttpsParameters params) {

                    // get the remote address if needed
                    InetSocketAddress remote = params.getClientAddress();
View Full Code Here

        HttpsServer httpsServer = HttpsServer.create(new InetSocketAddress(httpsProxyPort), 0);
        SSLContext sslContext = getSslContext();

        final SSLEngine m_engine = sslContext.createSSLEngine();

        httpsServer.setHttpsConfigurator(new HttpsConfigurator(sslContext) {
            public void configure(HttpsParameters params) {
                params.setCipherSuites(m_engine.getEnabledCipherSuites());
                params.setProtocols(m_engine.getEnabledProtocols());
            }
        });
View Full Code Here

          boolean needClientAuth = Strings.parseBoolean(cntx.getPrmNvl("needClientAuth", "false"));
          sslp.setNeedClientAuth(needClientAuth);
          boolean wantClientAuth = Strings.parseBoolean(cntx.getPrmNvl("wantClientAuth", "false"));
          sslp.setWantClientAuth(wantClientAuth);

          HttpsConfigurator conf = new HttpsConfigurator(sslContext) {
            public void configure(HttpsParameters params) {
              params.setSSLParameters(sslp);
            }
          };
View Full Code Here

          sslp.setNeedClientAuth(needClientAuth);
          boolean wantClientAuth = Strings.parseBoolean(cntx
              .getPrmNvl("wantClientAuth", "false"));
          sslp.setWantClientAuth(wantClientAuth);

          HttpsConfigurator conf = new HttpsConfigurator(sslContext) {
            public void configure(HttpsParameters params) {
              params.setSSLParameters(sslp);
            }
          };
View Full Code Here

        server = HttpsServer.create(new InetSocketAddress(port), 0);
      } else {
        server = HttpsServer.create(new InetSocketAddress(host, port), 0);
      }
      final SSLContext sslContext = getSslContext(config.getKeystore(), config.getKeyStorePassword());
      final HttpsConfigurator configurator = getConfigurator(sslContext);
      ((HttpsServer)server).setHttpsConfigurator(configurator);
      final RequestLimiter limiter = getRequestLimiterOrNull(config);
      final LinkedBlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<>();
      httpHandler = new LanguageToolHttpHandler(config.isVerbose(), allowedIps, runInternally, limiter, workQueue);
      httpHandler.setMaxTextLength(config.getMaxTextLength());
View Full Code Here

TOP

Related Classes of com.sun.net.httpserver.HttpsConfigurator

Copyright © 2018 www.massapicom. 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.