private ServerConnector createHttp11ServerConnector(Server server, HttpConfiguration config, SslContextFactory sslContextFactory) { HttpConnectionFactory connectionFactory = new HttpConnectionFactory(config); SslConnectionFactory sslConnectionFactory = new SslConnectionFactory( sslContextFactory, HttpVersion.HTTP_1_1.asString()); return new ServerConnector(server, sslConnectionFactory, connectionFactory); }
@Signature public String httpVersion() { return request.getHttpVersion().asString(); }
private static Server createServer(Handler handler, int port, KeyStore keyStore, String keyPassword) throws Exception { Server server = new Server(); SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setIncludeProtocols("TLSv1.2"); sslContextFactory.setKeyStore(keyStore); sslContextFactory.setKeyManagerPassword(keyPassword); HttpConfiguration httpsConfig = new HttpConfiguration(); httpsConfig.addCustomizer(new SecureRequestCustomizer()); ServerConnector sslConnector = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpsConfig)); sslConnector.setPort(port); server.addConnector(sslConnector); server.setHandler(handler); return server; }
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(new HttpConfiguration()) );
https_config.addCustomizer(new SecureRequestCustomizer()); ServerConnector https = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(https_config)); https.setPort(Integer.parseInt(globalProps.getProperty("serverPort"))); server.setConnectors(new Connector[]{https});
return new SslConnectionFactory( sslContextFactory, HttpVersion.HTTP_1_1.asString() );
HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpsConfig)); sslConnector.setPort(config.getInt(DrillOnYarnConfig.HTTP_PORT));
new SslConnectionFactory(factory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpsConfig) );
new SslConnectionFactory(sslCtxFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpConfiguration)); }).orElse(
LOGGER.info("Excluded protocols: {}", StringUtils.join(goSSLConfig.getProtocolsToBeExcluded(), ",")); LOGGER.info("Renegotiation Allowed: {}", goSSLConfig.isRenegotiationAllowed()); ServerConnector https = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpsConfig)); https.setHost(systemEnvironment.getListenHost()); https.setPort(systemEnvironment.getSslServerPort());
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpsConfig));
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(httpConfig));
private ServerConnector createHttpsChannelConnector( Server server, HttpConfiguration httpConfig) { httpConfig.setSecureScheme(HTTPS_SCHEME); httpConfig.addCustomizer(new SecureRequestCustomizer()); ServerConnector conn = createHttpChannelConnector(server, httpConfig); SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setNeedClientAuth(needsClientAuth); sslContextFactory.setKeyManagerPassword(keyPassword); if (keyStore != null) { sslContextFactory.setKeyStorePath(keyStore); sslContextFactory.setKeyStoreType(keyStoreType); sslContextFactory.setKeyStorePassword(keyStorePassword); } if (trustStore != null) { sslContextFactory.setTrustStorePath(trustStore); sslContextFactory.setTrustStoreType(trustStoreType); sslContextFactory.setTrustStorePassword(trustStorePassword); } if(null != excludeCiphers && !excludeCiphers.isEmpty()) { sslContextFactory.setExcludeCipherSuites( StringUtils.getTrimmedStrings(excludeCiphers)); LOG.info("Excluded Cipher List:" + excludeCiphers); } conn.addFirstConnectionFactory(new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString())); return conn; } }
public ProxyHTTPConnectionFactory(HttpConfiguration httpConfiguration,short version, ProxyEngineSelector proxyEngineSelector) { // replaces http/1.1 super(HttpVersion.HTTP_1_1.asString()); this.version = version; this.proxyEngineSelector = proxyEngineSelector; this.httpConfiguration=httpConfiguration; }
@Override public String getHttpVersion() { return getVersion().asString(); }
public HttpConnectionFactory(@Name("config") HttpConfiguration config, @Name("compliance") HttpCompliance compliance) { super(HttpVersion.HTTP_1_1.asString()); _config=config; _httpCompliance=compliance==null?HttpCompliance.RFC7230:compliance; if (config==null) throw new IllegalArgumentException("Null HttpConfiguration"); addBean(_config); }
private SslConnectionFactory createSslConnectionFactory(SpawnServiceConfiguration configuration) throws IOException { SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setKeyStorePath(configuration.keyStorePath); sslContextFactory.setKeyStorePassword(readFile(configuration.keyStorePassword)); sslContextFactory.setKeyManagerPassword(readFile(configuration.keyManagerPassword)); return new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()); }
private boolean getSendServerVersion(Connector connector) { ConnectionFactory connFactory = connector.getConnectionFactory(HttpVersion.HTTP_1_1.asString()); if (connFactory == null) return false; if (connFactory instanceof HttpConnectionFactory) { HttpConfiguration httpConf = ((HttpConnectionFactory) connFactory).getHttpConfiguration(); if (httpConf != null) return httpConf.getSendServerVersion(); } return false; }
private Fields createResponseHeaders(Stream clientStream, Response response) { Fields responseHeaders = new Fields(); for (HttpField header : response.getHeaders()) responseHeaders.add(header.getName(), header.getValue()); short version = clientStream.getSession().getVersion(); if (response.getStatus() > 0) responseHeaders.add(HTTPSPDYHeader.STATUS.name(version), String.valueOf(response.getStatus())); responseHeaders.add(HTTPSPDYHeader.VERSION.name(version), HttpVersion.HTTP_1_1.asString()); addResponseProxyHeaders(clientStream, responseHeaders); return responseHeaders; }
@Override public boolean startRequest(HttpMethod method, String methodString, ByteBuffer uri, HttpVersion httpVersion) { Connector connector = getConnector(); String scheme = connector.getConnectionFactory(SslConnectionFactory.class) != null ? "https" : "http"; headers.put(HTTPSPDYHeader.SCHEME.name(version), scheme); headers.put(HTTPSPDYHeader.METHOD.name(version), methodString); headers.put(HTTPSPDYHeader.URI.name(version), BufferUtil.toUTF8String(uri)); // TODO handle bad encodings headers.put(HTTPSPDYHeader.VERSION.name(version), httpVersion.asString()); return false; }