summaryrefslogtreecommitdiff
path: root/lib/https.js
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@iij.ad.jp>2015-04-23 15:25:15 +0900
committerShigeki Ohtsu <ohtsu@iij.ad.jp>2015-10-27 01:31:47 +0900
commit802a2e79e1adb22542ba12fba5e331e94277272d (patch)
tree601aa8947e9d78b0f9a912964738909ca40e086a /lib/https.js
parentdf738ac56c31ac8a04d6afbd3d7be59cfa5c2e9a (diff)
downloadandroid-node-v8-802a2e79e1adb22542ba12fba5e331e94277272d.tar.gz
android-node-v8-802a2e79e1adb22542ba12fba5e331e94277272d.tar.bz2
android-node-v8-802a2e79e1adb22542ba12fba5e331e94277272d.zip
tls, crypto: add ALPN Support
ALPN is added to tls according to RFC7301, which supersedes NPN. When the server receives both NPN and ALPN extensions from the client, ALPN takes precedence over NPN and the server does not send NPN extension to the client. alpnProtocol in TLSSocket always returns false when no selected protocol exists by ALPN. In https server, http/1.1 token is always set when no options.ALPNProtocols exists. PR-URL: https://github.com/nodejs/node/pull/2564 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/https.js')
-rw-r--r--lib/https.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/https.js b/lib/https.js
index abe4a20907..edf0aa4432 100644
--- a/lib/https.js
+++ b/lib/https.js
@@ -14,6 +14,13 @@ function Server(opts, requestListener) {
opts.NPNProtocols = ['http/1.1', 'http/1.0'];
}
+ if (process.features.tls_alpn && !opts.ALPNProtocols) {
+ // http/1.0 is not defined as Protocol IDs in IANA
+ // http://www.iana.org/assignments/tls-extensiontype-values
+ // /tls-extensiontype-values.xhtml#alpn-protocol-ids
+ opts.ALPNProtocols = ['http/1.1'];
+ }
+
tls.Server.call(this, opts, http._connectionListener);
this.httpAllowHalfOpen = false;