Permalink
Browse files

Allow HTTP/2 with letsencrypt (#3828)

* Allow HTTP/2 with letsencrypt

For some reason, `letsencrypt` forces the `NPNProtocols` option, which inhibits `spdy` from offering HTTP/2.

* lint
  • Loading branch information...
1 parent 633a55e commit b96b6fb2c2c984cbb4da66705e8a607615c210db @wmertens wmertens committed on GitHub Jan 10, 2017
Showing with 5 additions and 0 deletions.
  1. +5 −0 server/startSecureServer.js
@@ -28,6 +28,11 @@ module.exports = function (keystone, app, created, callback) {
var sniFunc;
var options = keystone.get('https server options') || {};
+ if (options.NPNProtocols && options.NPNProtocols.length === 1 && options.NPNProtocols[0] === 'http/1.1') {
+ // Remove default value so spdy can use its own better ones
+ delete options.NPNProtocols;
+ }
+
if (keystone.get('ssl cert') && fs.existsSync(keystone.getPath('ssl cert'))) {
options.cert = fs.readFileSync(keystone.getPath('ssl cert'));
}

0 comments on commit b96b6fb

Please sign in to comment.