Skip to content

Commit

Permalink
Revert httpolyglot
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Mar 29, 2017
1 parent 753327c commit efa6bef
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/server/http/setup_connection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { readFileSync } from 'fs';
import { format as formatUrl } from 'url';
import httpolyglot from '@elastic/httpolyglot';
import { map } from 'lodash';
import secureOptions from './secure_options';

Expand Down Expand Up @@ -35,8 +33,7 @@ export default function (kbnServer, server, config) {

server.connection({
...connectionOptions,
tls: true,
listener: httpolyglot.createServer({
tls: {
key: readFileSync(config.get('server.ssl.key')),
cert: readFileSync(config.get('server.ssl.certificate')),
ca: map(config.get('server.ssl.certificateAuthorities'), readFileSync),
Expand All @@ -46,22 +43,6 @@ export default function (kbnServer, server, config) {
// We use the server's cipher order rather than the client's to prevent the BEAST attack
honorCipherOrder: true,
secureOptions: secureOptions(config.get('server.ssl.supportedProtocols'))
})
});

server.ext('onRequest', function (req, reply) {
// A request sent through a HapiJS .inject() doesn't have a socket associated with the request
// which causes a failure.
if (!req.raw.req.socket || req.raw.req.socket.encrypted) {
reply.continue();
} else {
reply.redirect(formatUrl({
port,
protocol: 'https',
hostname: host,
pathname: req.url.pathname,
search: req.url.search,
}));
}
});
}

0 comments on commit efa6bef

Please sign in to comment.