Issue #2723 - Remove obsolete NPN prefs and callbacks.

NPN was removed from NSS a long time ago, this effectively does nothing.
ALPN also should be default-enabled (we do this by pref but the component
itself should have a sane default) so this was flipped as a drive-by fix.

Resolves #2723
This commit is contained in:
Moonchild 2025-06-16 20:33:16 +02:00 committed by roytam1
commit 5960178802
5 changed files with 6 additions and 51 deletions

View file

@ -1440,8 +1440,7 @@ nsNSSComponent::FillTLSVersionRange(SSLVersionRange& rangeOut,
static const int32_t OCSP_ENABLED_DEFAULT = 1;
static const bool REQUIRE_SAFE_NEGOTIATION_DEFAULT = false;
static const bool FALSE_START_ENABLED_DEFAULT = true;
static const bool NPN_ENABLED_DEFAULT = true;
static const bool ALPN_ENABLED_DEFAULT = false;
static const bool ALPN_ENABLED_DEFAULT = true;
static const bool ENABLED_0RTT_DATA_DEFAULT = false;
static const bool TLS13_COMPAT_MODE_DEFAULT = false;
static const bool HELLO_DOWNGRADE_CHECK_DEFAULT = true;
@ -1869,13 +1868,10 @@ nsNSSComponent::InitializeNSS()
Preferences::GetBool("security.ssl.enable_false_start",
FALSE_START_ENABLED_DEFAULT));
// SSL_ENABLE_NPN and SSL_ENABLE_ALPN also require calling
// SSL_SetNextProtoNego in order for the extensions to be negotiated.
// WebRTC does not do that so it will not use NPN or ALPN even when these
// preferences are true.
SSL_OptionSetDefault(SSL_ENABLE_NPN,
Preferences::GetBool("security.ssl.enable_npn",
NPN_ENABLED_DEFAULT));
// SSL_ENABLE_ALPN also requires calling SSL_SetNextProtoNego in order for
// the extensions to be negotiated.
// WebRTC does not do that so it will not use ALPN even when this preference
// is true.
SSL_OptionSetDefault(SSL_ENABLE_ALPN,
Preferences::GetBool("security.ssl.enable_alpn",
ALPN_ENABLED_DEFAULT));
@ -2066,10 +2062,6 @@ nsNSSComponent::Observe(nsISupports* aSubject, const char* aTopic,
SSL_OptionSetDefault(SSL_ENABLE_FALSE_START,
Preferences::GetBool("security.ssl.enable_false_start",
FALSE_START_ENABLED_DEFAULT));
} else if (prefName.EqualsLiteral("security.ssl.enable_npn")) {
SSL_OptionSetDefault(SSL_ENABLE_NPN,
Preferences::GetBool("security.ssl.enable_npn",
NPN_ENABLED_DEFAULT));
} else if (prefName.EqualsLiteral("security.ssl.enable_alpn")) {
SSL_OptionSetDefault(SSL_ENABLE_ALPN,
Preferences::GetBool("security.ssl.enable_alpn",