| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3522294 commit 5e901b5
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,11 +19,6 @@ | |||
| 19 | 19 | { | |
| 20 | 20 | 'target_name': 'openssl', | |
| 21 | 21 | 'type': '<(library)', | |
| 22 | - 'dependencies': [ | ||
| 23 | - '../zlib/zlib.gyp:zlib', | ||
| 24 | - '../brotli/brotli.gyp:brotli', | ||
| 25 | - '../zstd/zstd.gyp:zstd', | ||
| 26 | - ], | ||
| 27 | 22 | 'includes': ['./openssl_common.gypi'], | |
| 28 | 23 | 'defines': [ | |
| 29 | 24 | # Compile out hardware engines. Most are stubs that dynamically load | |
@@ -54,6 +49,15 @@ | |||
| 54 | 49 | 'MODULESDIR="<(modules_dir)"', | |
| 55 | 50 | ] | |
| 56 | 51 | }], | |
| 52 | + ['node_shared_zlib=="false"', { | ||
| 53 | + 'dependencies': [ '../zlib/zlib.gyp:zlib' ], | ||
| 54 | + }], | ||
| 55 | + ['node_shared_brotli=="false"', { | ||
| 56 | + 'dependencies': [ '../brotli/brotli.gyp:brotli' ], | ||
| 57 | + }], | ||
| 58 | + ['node_shared_zstd=="false"', { | ||
| 59 | + 'dependencies': [ '../zstd/zstd.gyp:zstd' ], | ||
| 60 | + }], | ||
| 57 | 61 | ], | |
| 58 | 62 | 'direct_dependent_settings': { | |
| 59 | 63 | 'include_dirs': [ 'openssl/include', 'openssl/crypto/include'] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1895,6 +1895,9 @@ argument. | |||
| 1895 | 1895 | <!-- YAML | |
| 1896 | 1896 | added: v0.11.13 | |
| 1897 | 1897 | changes: | |
| 1898 | + - version: REPLACEME | ||
| 1899 | + pr-url: https://github.com/nodejs/node/pull/62217 | ||
| 1900 | + description: The `certificateCompression` option has been added. | ||
| 1898 | 1901 | - version: | |
| 1899 | 1902 | - v22.9.0 | |
| 1900 | 1903 | - v20.18.0 | |
@@ -1988,6 +1991,12 @@ changes: | |||
| 1988 | 1991 | the same order as their private keys in `key`. If the intermediate | |
| 1989 | 1992 | certificates are not provided, the peer will not be able to validate the | |
| 1990 | 1993 | certificate, and the handshake will fail. | |
| 1994 | + * `certificateCompression` {string\[]} An array of supported certificate | ||
| 1995 | + compression algorithm names, in preference order. Supported values are | ||
| 1996 | + `'zlib'`, `'brotli'`, and `'zstd'`. When set, enables TLS certificate | ||
| 1997 | + compression ([RFC 8879][]) which compresses certificates during the TLS | ||
| 1998 | + handshake, reducing handshake size. Only effective with TLSv1.3. | ||
| 1999 | + **Default:** `[]` (disabled). | ||
| 1991 | 2000 | * `sigalgs` {string} Colon-separated list of supported signature algorithms. | |
| 1992 | 2001 | The list can contain digest algorithms (`SHA256`, `MD5` etc.), public key | |
| 1993 | 2002 | algorithms (`RSA-PSS`, `ECDSA` etc.), combination of both (e.g | |
@@ -2376,6 +2385,25 @@ TLSv1.2 and below. | |||
| 2376 | 2385 | console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] | |
| 2377 | 2386 | ``` | |
| 2378 | 2387 | ||
| 2388 | + ## `tls.getCertificateCompressionAlgorithms()` | ||
| 2389 | + | ||
| 2390 | + <!-- YAML | ||
| 2391 | + added: REPLACEME | ||
| 2392 | + --> | ||
| 2393 | + | ||
| 2394 | + * Returns: {string\[]} | ||
| 2395 | + | ||
| 2396 | + Returns an array with the names of the RFC 8879 certificate compression | ||
| 2397 | + algorithms supported by the current OpenSSL build, suitable for use in the | ||
| 2398 | + `certificateCompression` option of [`tls.createSecureContext()`][]. Possible | ||
| 2399 | + values include `'zlib'`, `'brotli'`, and `'zstd'`. | ||
| 2400 | + | ||
| 2401 | + The array is empty when certificate compression is unavailable. | ||
| 2402 | + | ||
| 2403 | + ```js | ||
| 2404 | + console.log(tls.getCertificateCompressionAlgorithms()); // ['zlib', 'brotli', 'zstd'] | ||
| 2405 | + ``` | ||
| 2406 | + | ||
| 2379 | 2407 | ## `tls.rootCertificates` | |
| 2380 | 2408 | ||
| 2381 | 2409 | <!-- YAML | |
@@ -2467,6 +2495,7 @@ added: v0.11.3 | |||
| 2467 | 2495 | [RFC 4279]: https://tools.ietf.org/html/rfc4279 | |
| 2468 | 2496 | [RFC 5077]: https://tools.ietf.org/html/rfc5077 | |
| 2469 | 2497 | [RFC 5929]: https://tools.ietf.org/html/rfc5929 | |
| 2498 | + [RFC 8879]: https://tools.ietf.org/html/rfc8879 | ||
| 2470 | 2499 | [SSL_METHODS]: https://www.openssl.org/docs/man1.1.1/man7/ssl.html#Dealing-with-Protocol-Methods | |
| 2471 | 2500 | [Session Resumption]: #session-resumption | |
| 2472 | 2501 | [Stream]: stream.md#stream | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,6 +133,7 @@ function configSecureContext(context, options = kEmptyObject, name = 'options') | |||
| 133 | 133 | allowPartialTrustChain, | |
| 134 | 134 | ca, | |
| 135 | 135 | cert, | |
| 136 | + certificateCompression, | ||
| 136 | 137 | ciphers = getDefaultCiphers(), | |
| 137 | 138 | clientCertEngine, | |
| 138 | 139 | crl, | |
@@ -210,6 +211,43 @@ function configSecureContext(context, options = kEmptyObject, name = 'options') | |||
| 210 | 211 | } | |
| 211 | 212 | } | |
| 212 | 213 | ||
| 214 | + if (certificateCompression != null) { | ||
| 215 | + if (!ArrayIsArray(certificateCompression)) { | ||
| 216 | + throw new ERR_INVALID_ARG_TYPE( | ||
| 217 | + `${name}.certificateCompression`, 'Array', certificateCompression); | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + if (certificateCompression.length > 0) { | ||
| 221 | + // Pack length + algorithm IDs into a single Uint32 for a cheap | ||
| 222 | + // JS->C++ crossing. Layout: | ||
| 223 | + // bits 0-7 : length (1..3) | ||
| 224 | + // bits 8-15: alg id at position 0 | ||
| 225 | + // bits 16-23: alg id at position 1 | ||
| 226 | + // bits 24-31: alg id at position 2 | ||
| 227 | + // IDs match OpenSSL's TLSEXT_comp_cert_zlib (1), _brotli (2), _zstd (3) | ||
| 228 | + if (certificateCompression.length > 3) { | ||
| 229 | + throw new ERR_INVALID_ARG_VALUE( | ||
| 230 | + `${name}.certificateCompression`, certificateCompression, | ||
| 231 | + 'can specify at most 3 algorithms'); | ||
| 232 | + } | ||
| 233 | + let packed = certificateCompression.length; | ||
| 234 | + for (let i = 0; i < certificateCompression.length; i++) { | ||
| 235 | + const algoName = certificateCompression[i]; | ||
| 236 | + let id; | ||
| 237 | + if (algoName === 'zlib') id = 1; | ||
| 238 | + else if (algoName === 'brotli') id = 2; | ||
| 239 | + else if (algoName === 'zstd') id = 3; | ||
| 240 | + else { | ||
| 241 | + throw new ERR_INVALID_ARG_VALUE( | ||
| 242 | + `${name}.certificateCompression[${i}]`, algoName, | ||
| 243 | + "must be 'zlib', 'brotli', or 'zstd'"); | ||
| 244 | + } | ||
| 245 | + packed |= id << (8 * (i + 1)); | ||
| 246 | + } | ||
| 247 | + context.setCertificateCompression(packed); | ||
| 248 | + } | ||
| 249 | + } | ||
| 250 | + | ||
| 213 | 251 | if (sigalgs !== undefined && sigalgs !== null) { | |
| 214 | 252 | validateString(sigalgs, `${name}.sigalgs`); | |
| 215 | 253 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1621,6 +1621,7 @@ Server.prototype.setSecureContext = function(options) { | |||
| 1621 | 1621 | ||
| 1622 | 1622 | this.privateKeyIdentifier = options.privateKeyIdentifier; | |
| 1623 | 1623 | this.privateKeyEngine = options.privateKeyEngine; | |
| 1624 | + this.certificateCompression = options.certificateCompression; | ||
| 1624 | 1625 | ||
| 1625 | 1626 | this._sharedCreds = tls.createSecureContext({ | |
| 1626 | 1627 | pfx: this.pfx, | |
@@ -1644,6 +1645,7 @@ Server.prototype.setSecureContext = function(options) { | |||
| 1644 | 1645 | sessionTimeout: this.sessionTimeout, | |
| 1645 | 1646 | privateKeyIdentifier: this.privateKeyIdentifier, | |
| 1646 | 1647 | privateKeyEngine: this.privateKeyEngine, | |
| 1648 | + certificateCompression: this.certificateCompression, | ||
| 1647 | 1649 | }); | |
| 1648 | 1650 | }; | |
| 1649 | 1651 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,7 @@ const { | |||
| 47 | 47 | resetRootCertStore, | |
| 48 | 48 | getUserRootCertificates, | |
| 49 | 49 | getSSLCiphers, | |
| 50 | + getCertificateCompressionAlgorithms, | ||
| 50 | 51 | startLoadingCertificatesOffThread, | |
| 51 | 52 | } = internalBinding('crypto'); | |
| 52 | 53 | ||
@@ -113,6 +114,10 @@ exports.getCiphers = internalUtil.cachedResult( | |||
| 113 | 114 | () => internalUtil.filterDuplicateStrings(getSSLCiphers(), true), | |
| 114 | 115 | ); | |
| 115 | 116 | ||
| 117 | + exports.getCertificateCompressionAlgorithms = internalUtil.cachedResult( | ||
| 118 | + () => getCertificateCompressionAlgorithms(), | ||
| 119 | + ); | ||
| 120 | + | ||
| 116 | 121 | let bundledRootCertificates; | |
| 117 | 122 | function cacheBundledRootCertificates() { | |
| 118 | 123 | bundledRootCertificates ||= ObjectFreeze(getBundledRootCertificates()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,9 +12,10 @@ | |||
| 12 | 12 | #include "util.h" | |
| 13 | 13 | #include "v8.h" | |
| 14 | 14 | ||
| 15 | - #include <openssl/x509.h> | ||
| 15 | + #include <openssl/comp.h> | ||
| 16 | 16 | #include <openssl/pkcs12.h> | |
| 17 | 17 | #include <openssl/rand.h> | |
| 18 | + #include <openssl/x509.h> | ||
| 18 | 19 | #ifndef OPENSSL_NO_ENGINE | |
| 19 | 20 | #include <openssl/engine.h> | |
| 20 | 21 | #endif // !OPENSSL_NO_ENGINE | |
@@ -1308,6 +1309,8 @@ Local<FunctionTemplate> SecureContext::GetConstructorTemplate( | |||
| 1308 | 1309 | SetProtoMethod(isolate, tmpl, "setOptions", SetOptions); | |
| 1309 | 1310 | SetProtoMethod(isolate, tmpl, "setSessionIdContext", SetSessionIdContext); | |
| 1310 | 1311 | SetProtoMethod(isolate, tmpl, "setSessionTimeout", SetSessionTimeout); | |
| 1312 | + SetProtoMethod( | ||
| 1313 | + isolate, tmpl, "setCertificateCompression", SetCertificateCompression); | ||
| 1311 | 1314 | SetProtoMethod(isolate, tmpl, "close", Close); | |
| 1312 | 1315 | SetProtoMethod(isolate, tmpl, "loadPKCS12", LoadPKCS12); | |
| 1313 | 1316 | SetProtoMethod(isolate, tmpl, "setTicketKeys", SetTicketKeys); | |
@@ -1372,6 +1375,10 @@ void SecureContext::Initialize(Environment* env, Local<Object> target) { | |||
| 1372 | 1375 | target, | |
| 1373 | 1376 | "startLoadingCertificatesOffThread", | |
| 1374 | 1377 | StartLoadingCertificatesOffThread); | |
| 1378 | + SetMethodNoSideEffect(context, | ||
| 1379 | + target, | ||
| 1380 | + "getCertificateCompressionAlgorithms", | ||
| 1381 | + GetCertificateCompressionAlgorithms); | ||
| 1375 | 1382 | } | |
| 1376 | 1383 | ||
| 1377 | 1384 | void SecureContext::RegisterExternalReferences( | |
@@ -1396,6 +1403,7 @@ void SecureContext::RegisterExternalReferences( | |||
| 1396 | 1403 | registry->Register(SetOptions); | |
| 1397 | 1404 | registry->Register(SetSessionIdContext); | |
| 1398 | 1405 | registry->Register(SetSessionTimeout); | |
| 1406 | + registry->Register(SetCertificateCompression); | ||
| 1399 | 1407 | registry->Register(Close); | |
| 1400 | 1408 | registry->Register(LoadPKCS12); | |
| 1401 | 1409 | registry->Register(SetTicketKeys); | |
@@ -1417,6 +1425,7 @@ void SecureContext::RegisterExternalReferences( | |||
| 1417 | 1425 | registry->Register(ResetRootCertStore); | |
| 1418 | 1426 | registry->Register(GetUserRootCertificates); | |
| 1419 | 1427 | registry->Register(StartLoadingCertificatesOffThread); | |
| 1428 | + registry->Register(GetCertificateCompressionAlgorithms); | ||
| 1420 | 1429 | } | |
| 1421 | 1430 | ||
| 1422 | 1431 | SecureContext* SecureContext::Create(Environment* env) { | |
@@ -1554,6 +1563,14 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) { | |||
| 1554 | 1563 | env->external_memory_accounter()->Increase(env->isolate(), kExternalSize); | |
| 1555 | 1564 | SSL_CTX_set_app_data(sc->ctx_.get(), sc); | |
| 1556 | 1565 | ||
| 1566 | + // OpenSSL populates cert_comp_prefs with all available algorithms by | ||
| 1567 | + // default when compression libraries are linked. Clear them so that | ||
| 1568 | + // certificate compression (RFC 8879) is always opt-in for now, via | ||
| 1569 | + // the certificateCompression option. | ||
| 1570 | + #ifdef NODE_OPENSSL_HAS_CERT_COMP | ||
| 1571 | + SSL_CTX_set1_cert_comp_preference(sc->ctx_.get(), nullptr, 0); | ||
| 1572 | + #endif | ||
| 1573 | + | ||
| 1557 | 1574 | // Disable SSLv2 in the case when method == TLS_method() and the | |
| 1558 | 1575 | // cipher list contains SSLv2 ciphers (not the default, should be rare.) | |
| 1559 | 1576 | // The bundled OpenSSL doesn't have SSLv2 support but the system OpenSSL may. | |
@@ -2059,6 +2076,100 @@ void SecureContext::SetSessionTimeout(const FunctionCallbackInfo<Value>& args) { | |||
| 2059 | 2076 | SSL_CTX_set_timeout(sc->ctx_.get(), sessionTimeout); | |
| 2060 | 2077 | } | |
| 2061 | 2078 | ||
| 2079 | + void SecureContext::SetCertificateCompression( | ||
| 2080 | + const FunctionCallbackInfo<Value>& args) { | ||
| 2081 | + SecureContext* sc; | ||
| 2082 | + ASSIGN_OR_RETURN_UNWRAP(&sc, args.This()); | ||
| 2083 | + Environment* env = sc->env(); | ||
| 2084 | + | ||
| 2085 | + CHECK_GE(args.Length(), 1); | ||
| 2086 | + CHECK(args[0]->IsUint32()); | ||
| 2087 | + | ||
| 2088 | + // Cert compression requires TLS 1.3: | ||
| 2089 | + long max_proto = // NOLINT(runtime/int) | ||
| 2090 | + SSL_CTX_get_max_proto_version(sc->ctx_.get()); | ||
| 2091 | + if (max_proto != 0 && max_proto < TLS1_3_VERSION) { | ||
| 2092 | + return THROW_ERR_INVALID_ARG_VALUE( | ||
| 2093 | + env, | ||
| 2094 | + "certificateCompression requires a TLS protocol range that includes " | ||
| 2095 | + "TLSv1.3"); | ||
| 2096 | + } | ||
| 2097 | + | ||
| 2098 | + #ifdef NODE_OPENSSL_HAS_CERT_COMP | ||
| 2099 | + // JS packs (length | alg0<<8 | alg1<<16 | alg2<<24) into a single Uint32. | ||
| 2100 | + // IDs match TLSEXT_comp_cert_zlib (1), _brotli (2), _zstd (3). | ||
| 2101 | + uint32_t packed = args[0].As<v8::Uint32>()->Value(); | ||
| 2102 | + size_t len = packed & 0xff; | ||
| 2103 | + | ||
| 2104 | + // TLSEXT_comp_cert_limit is the limit for a zero-terminated algs array, | ||
| 2105 | + // total number of available algs is one fewer. | ||
| 2106 | + constexpr size_t kMaxCompAlgs = TLSEXT_comp_cert_limit - 1; | ||
| 2107 | + if (len == 0 || len > kMaxCompAlgs) { | ||
| 2108 | + return THROW_ERR_INVALID_ARG_VALUE( | ||
| 2109 | + env, | ||
| 2110 | + "certificateCompression must specify fewer than %d algorithms", | ||
| 2111 | + static_cast<int>(kMaxCompAlgs)); | ||
| 2112 | + } | ||
| 2113 | + | ||
| 2114 | + int algs[kMaxCompAlgs]; | ||
| 2115 | + for (size_t i = 0; i < len; i++) { | ||
| 2116 | + algs[i] = (packed >> (8 * (i + 1))) & 0xff; | ||
| 2117 | + } | ||
| 2118 | + if (!SSL_CTX_set1_cert_comp_preference( | ||
| 2119 | + sc->ctx_.get(), algs, static_cast<size_t>(len))) { | ||
| 2120 | + return THROW_ERR_CRYPTO_OPERATION_FAILED( | ||
| 2121 | + env, "Failed to set certificate compression preference"); | ||
| 2122 | + } | ||
| 2123 | + | ||
| 2124 | + // Pre-compress the loaded certificate(s) for all supported algorithms. | ||
| 2125 | + // Returns 0 when no certificate is loaded (e.g. client-only context) or | ||
| 2126 | + // when compression did not reduce size - both are non-fatal. | ||
| 2127 | + constexpr int kCompressAllAlgs = 0; | ||
| 2128 | + SSL_CTX_compress_certs(sc->ctx_.get(), kCompressAllAlgs); | ||
| 2129 | + | ||
| 2130 | + // Store preferences for propagation during SNI context switches. | ||
| 2131 | + memcpy(sc->cert_comp_prefs_, algs, sizeof(int) * len); | ||
| 2132 | + sc->cert_comp_prefs_len_ = len; | ||
| 2133 | + | ||
| 2134 | + // Cache pre-compressed cert data for SNI context switches. | ||
| 2135 | + // setSniContext uses SSL_use_certificate which doesn't carry comp_cert data, | ||
| 2136 | + // so we extract it here and re-apply via SSL_set1_compressed_cert later. | ||
| 2137 | + sc->compressed_certs_.clear(); | ||
| 2138 | + for (size_t i = 0; i < len; i++) { | ||
| 2139 | + unsigned char* data = nullptr; | ||
| 2140 | + size_t orig_len = 0; | ||
| 2141 | + size_t comp_len = | ||
| 2142 | + SSL_CTX_get1_compressed_cert(sc->ctx_.get(), algs[i], &data, &orig_len); | ||
| 2143 | + ncrypto::DataPointer comp(data, comp_len); | ||
| 2144 | + if (comp_len > 0 && data != nullptr) { | ||
| 2145 | + sc->compressed_certs_.push_back( | ||
| 2146 | + {algs[i], | ||
| 2147 | + std::vector<unsigned char>(data, data + comp_len), | ||
| 2148 | + orig_len}); | ||
| 2149 | + } | ||
| 2150 | + } | ||
| 2151 | + #else | ||
| 2152 | + return THROW_ERR_CRYPTO_UNSUPPORTED_OPERATION( | ||
| 2153 | + env, "Certificate compression is not supported by this OpenSSL build"); | ||
| 2154 | + #endif | ||
| 2155 | + } | ||
| 2156 | + | ||
| 2157 | + void SecureContext::GetCertificateCompressionAlgorithms( | ||
| 2158 | + const FunctionCallbackInfo<Value>& args) { | ||
| 2159 | + Environment* env = Environment::GetCurrent(args); | ||
| 2160 | + LocalVector<Value> algs(env->isolate()); | ||
| 2161 | + #ifdef NODE_OPENSSL_HAS_CERT_COMP | ||
| 2162 | + if (BIO_f_zlib() != nullptr) | ||
| 2163 | + algs.push_back(FIXED_ONE_BYTE_STRING(env->isolate(), "zlib")); | ||
| 2164 | + if (BIO_f_brotli() != nullptr) | ||
| 2165 | + algs.push_back(FIXED_ONE_BYTE_STRING(env->isolate(), "brotli")); | ||
| 2166 | + if (BIO_f_zstd() != nullptr) | ||
| 2167 | + algs.push_back(FIXED_ONE_BYTE_STRING(env->isolate(), "zstd")); | ||
| 2168 | + #endif | ||
| 2169 | + args.GetReturnValue().Set( | ||
| 2170 | + Array::New(env->isolate(), algs.data(), algs.size())); | ||
| 2171 | + } | ||
| 2172 | + | ||
| 2062 | 2173 | void SecureContext::Close(const FunctionCallbackInfo<Value>& args) { | |
| 2063 | 2174 | SecureContext* sc; | |
| 2064 | 2175 | ASSIGN_OR_RETURN_UNWRAP(&sc, args.This()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,10 @@ | |||
| 10 | 10 | #include "memory_tracker.h" | |
| 11 | 11 | #include "v8.h" | |
| 12 | 12 | ||
| 13 | + #ifdef NODE_OPENSSL_HAS_CERT_COMP | ||
| 14 | + #include <vector> | ||
| 15 | + #endif | ||
| 16 | + | ||
| 13 | 17 | namespace node { | |
| 14 | 18 | namespace crypto { | |
| 15 | 19 | // A maxVersion of 0 means "any", but OpenSSL may support TLS versions that | |
@@ -47,6 +51,27 @@ class SecureContext final : public BaseObject { | |||
| 47 | 51 | // the SecureContext. | |
| 48 | 52 | ncrypto::SSLCtxPointer& ctx() { return ctx_; } | |
| 49 | 53 | ||
| 54 | + #ifdef NODE_OPENSSL_HAS_CERT_COMP | ||
| 55 | + bool HasCertCompression() const { | ||
| 56 | + return cert_comp_prefs_len_ > 0; | ||
| 57 | + } | ||
| 58 | + int* CertCompPrefs() { | ||
| 59 | + return cert_comp_prefs_; | ||
| 60 | + } | ||
| 61 | + size_t CertCompPrefsLen() const { | ||
| 62 | + return cert_comp_prefs_len_; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + struct CompressedCertData { | ||
| 66 | + int algorithm; | ||
| 67 | + std::vector<unsigned char> data; | ||
| 68 | + size_t orig_length; | ||
| 69 | + }; | ||
| 70 | + const std::vector<CompressedCertData>& CompressedCerts() const { | ||
| 71 | + return compressed_certs_; | ||
| 72 | + } | ||
| 73 | + #endif | ||
| 74 | + | ||
| 50 | 75 | ncrypto::SSLPointer CreateSSL(); | |
| 51 | 76 | ||
| 52 | 77 | void SetGetSessionCallback(GetSessionCb cb); | |
@@ -106,6 +131,10 @@ class SecureContext final : public BaseObject { | |||
| 106 | 131 | const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 107 | 132 | static void SetSessionTimeout( | |
| 108 | 133 | const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 134 | + static void SetCertificateCompression( | ||
| 135 | + const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| 136 | + static void GetCertificateCompressionAlgorithms( | ||
| 137 | + const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| 109 | 138 | static void SetMinProto(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 110 | 139 | static void SetMaxProto(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 111 | 140 | static void GetMinProto(const v8::FunctionCallbackInfo<v8::Value>& args); | |
@@ -156,6 +185,12 @@ class SecureContext final : public BaseObject { | |||
| 156 | 185 | unsigned char ticket_key_name_[16]; | |
| 157 | 186 | unsigned char ticket_key_aes_[16]; | |
| 158 | 187 | unsigned char ticket_key_hmac_[16]; | |
| 188 | + | ||
| 189 | + #ifdef NODE_OPENSSL_HAS_CERT_COMP | ||
| 190 | + int cert_comp_prefs_[TLSEXT_comp_cert_limit] = {}; | ||
| 191 | + size_t cert_comp_prefs_len_ = 0; | ||
| 192 | + std::vector<CompressedCertData> compressed_certs_; | ||
| 193 | + #endif | ||
| 159 | 194 | }; | |
| 160 | 195 | ||
| 161 | 196 | int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments