Skip to content

Commit 9f8c6e3

Browse files
committed
crypto: remove ALPN_ENABLED
This constant was likely introduced for feature detection, but it has been pointless for a long time. 1. I am not aware of any possible Node.js build configuration (on any recent/supported release line) that would have crypto.constants but not crypto.constants.ALPN_ENABLED. 2. There is no evidence of this constant being used for feature detection in the ecosystem. In fact, both internal and external type definitions for crypto.constants simply assume that the constant exists. 3. There is no good reason for any modern TLS stack to not support ALPN. It looks like ALPN might have been optional in much earlier versions of OpenSSL, but all recent versions of OpenSSL unconditionally support ALPN as far as I can tell. Refs: nodejs#46956
1 parent bcebb91 commit 9f8c6e3

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

doc/api/crypto.md

-4
Original file line numberDiff line numberDiff line change
@@ -5980,10 +5980,6 @@ See the [list of SSL OP Flags][] for details.
59805980
<td><code>DH_NOT_SUITABLE_GENERATOR</code></td>
59815981
<td></td>
59825982
</tr>
5983-
<tr>
5984-
<td><code>ALPN_ENABLED</code></td>
5985-
<td></td>
5986-
</tr>
59875983
<tr>
59885984
<td><code>RSA_PKCS1_PADDING</code></td>
59895985
<td></td>

src/node_constants.cc

-3
Original file line numberDiff line numberDiff line change
@@ -1032,9 +1032,6 @@ void DefineCryptoConstants(Local<Object> target) {
10321032
NODE_DEFINE_CONSTANT(target, DH_NOT_SUITABLE_GENERATOR);
10331033
#endif
10341034

1035-
#define ALPN_ENABLED 1
1036-
NODE_DEFINE_CONSTANT(target, ALPN_ENABLED);
1037-
10381035
#ifdef RSA_PKCS1_PADDING
10391036
NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PADDING);
10401037
#endif

typings/internalBinding/constants.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ declare function InternalBinding(binding: 'constants'): {
243243
DH_CHECK_P_NOT_PRIME: 1;
244244
DH_UNABLE_TO_CHECK_GENERATOR: 4;
245245
DH_NOT_SUITABLE_GENERATOR: 8;
246-
ALPN_ENABLED: 1;
247246
RSA_PKCS1_PADDING: 1;
248247
RSA_SSLV23_PADDING: 2;
249248
RSA_NO_PADDING: 3;

0 commit comments

Comments
 (0)