diff options
author | Shigeki Ohtsu <ohtsu@iij.ad.jp> | 2015-04-23 09:25:15 +0300 |
---|---|---|
committer | Shigeki Ohtsu <ohtsu@iij.ad.jp> | 2015-10-26 19:31:47 +0300 |
commit | 802a2e79e1adb22542ba12fba5e331e94277272d (patch) | |
tree | 601aa8947e9d78b0f9a912964738909ca40e086a /src/node_constants.cc | |
parent | df738ac56c31ac8a04d6afbd3d7be59cfa5c2e9a (diff) |
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 'src/node_constants.cc')
-rw-r--r-- | src/node_constants.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node_constants.cc b/src/node_constants.cc index 51c2ee814ae..1259f83697c 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -935,6 +935,11 @@ void DefineOpenSSLConstants(Local<Object> target) { NODE_DEFINE_CONSTANT(target, NPN_ENABLED); #endif +#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation +#define ALPN_ENABLED 1 + NODE_DEFINE_CONSTANT(target, ALPN_ENABLED); +#endif + #ifdef RSA_PKCS1_PADDING NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PADDING); #endif |