From 864b97b24dc07c13fafd2cd717e33035c28e67e2 Mon Sep 17 00:00:00 2001 From: Mateusz Krawczuk Date: Thu, 6 Aug 2020 00:32:07 +0200 Subject: [PATCH] tls: use recently added matching SecureContext in default SNICallback PR-URL: https://github.com/nodejs/node/pull/36072 Fixes: https://github.com/nodejs/node/issues/34110 Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen --- doc/api/tls.md | 3 + lib/_tls_wrap.js | 3 +- .../test-tls-secure-context-usage-order.js | 99 +++++++++++++++++++ 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-tls-secure-context-usage-order.js diff --git a/doc/api/tls.md b/doc/api/tls.md index bedf4e28e7bc04..2c8414f2988c9c 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -627,6 +627,9 @@ added: v0.5.3 The `server.addContext()` method adds a secure context that will be used if the client request's SNI name matches the supplied `hostname` (or wildcard). +When there are multiple matching contexts, the most recently added one is +used. + ### `server.address()`