Skip to content

Commit

Permalink
node new store add partial chain flag
Browse files Browse the repository at this point in the history
* Update .patches

Co-authored-by: Lin Cheng <lin_cheng@dell.com>
  • Loading branch information
lcheng668 committed Mar 31, 2023
1 parent 8d4df8b commit cc18c8c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions patches/node/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ fix-creates-a-new-without-fill-buffer-issues.patch
src_remove_execsync_return_stderr_write_to_process.patch
support-SSL-select-client-cert-callback-on-tls.patch
src-add-crypto-wrapper-for-node-openssl.patch
src_new_store_add_partial_chain_flag.patch
38 changes: 38 additions & 0 deletions patches/node/src_new_store_add_partial_chain_flag.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 660ed8492a13371c96ec0aa9bd99dfce43ed49ed Mon Sep 17 00:00:00 2001
From: Lin Cheng <lin_cheng@dell.com>
Date: Thu, 30 Mar 2023 06:34:48 +0000
Subject: [PATCH] nodejs root store add partial chain flag

* Update .patches

Co-authored-by: Lin Cheng <lin_cheng@dell.com>
---
src/crypto/crypto_context.cc | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc
index a5fe5e906b..54c07c30e5 100644
--- a/src/crypto/crypto_context.cc
+++ b/src/crypto/crypto_context.cc
@@ -714,6 +714,10 @@ void SecureContext::AddCACert(const FunctionCallbackInfo<Value>& args) {
Thin_SSL_CTX_add_client_CA(sc->ctx_.get(), x509);
Thin_X509_free(x509);
}
+
+ if (cert_store) {
+ Thin_X509_STORE_set_flags(cert_store, X509_V_FLAG_PARTIAL_CHAIN);
+ }
}

void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
@@ -758,6 +762,7 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {

// Increment reference count so global store is not deleted along with CTX.
Thin_X509_STORE_up_ref(root_cert_store);
+ Thin_X509_STORE_set_flags(root_cert_store, X509_V_FLAG_PARTIAL_CHAIN);
Thin_SSL_CTX_set_cert_store(sc->ctx_.get(), root_cert_store);
}

--
2.25.1

0 comments on commit cc18c8c

Please sign in to comment.