Blob Blame History Raw
From acc0bf44f8f822bf1dd07f62c8d2533ad4f0c1ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= <jstanek@redhat.com>
Date: Tue, 28 Apr 2020 11:15:24 +0200
Subject: [PATCH] Link with ssl-shim
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Jan Staněk <jstanek@redhat.com>
---
 node.gypi          | 10 +++++++---
 src/node_crypto.cc |  2 +-
 src/node_crypto.h  |  2 ++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/node.gypi b/node.gypi
index ad088b133b..45f6a9f45c 100644
--- a/node.gypi
+++ b/node.gypi
@@ -361,9 +361,13 @@
               ],
             }],
           ],
-        }]]
-
-    }, {
+        }],
+        [ 'node_shared_openssl=="true"', {
+          'include_dirs': ['deps/node-ssl-shim/include'],
+          'libraries': ['<!(realpath deps/node-ssl-shim/lib/libnode-ssl-shim.a)']
+        }]
+    ]},
+    {
       'defines': [ 'HAVE_OPENSSL=0' ]
     }],
 
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 61e5a32854..d7c7d06646 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -1174,7 +1174,7 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {
 
 void SecureContext::SetCipherSuites(const FunctionCallbackInfo<Value>& args) {
   // BoringSSL doesn't allow API config of TLS1.3 cipher suites.
-#ifndef OPENSSL_IS_BORINGSSL
+#if !defined OPENSSL_IS_BORINGSSL && !OPENSSL_IS_LEGACY
   SecureContext* sc;
   ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
   Environment* env = sc->env();
diff --git a/src/node_crypto.h b/src/node_crypto.h
index bef98b3e24..d46730c9ba 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -42,6 +42,8 @@
 #include <openssl/ec.h>
 #include <openssl/rsa.h>
 
+#include <node-ssl-shim/ssl-shim.h>
+
 namespace node {
 namespace crypto {
 
-- 
2.36.1