]>
Commit | Line | Data |
---|---|---|
58e86022 ER |
1 | Description: do not bundle CA certificates, openssl on Debian have them |
2 | As a consequence, nodejs must depend on ca-certificates. | |
318ea6db | 3 | Forwarded: https://github.com/nodejs/node/issues/3159 |
58e86022 | 4 | Author: Jérémy Lal <kapouer@melix.org> |
58e86022 | 5 | Modified 2014-08-11 by Elan Ruusamäe <glen@delfi.ee> with the correct path for PLD |
3de234b3 | 6 | Modified 2015-10-17 by Elan Ruusamäe <glen@delfi.ee> updated for node 4.2.1-LTS |
a5a3e195 ER |
7 | Modified 2017-11-02 by Elan Ruusamäe <glen@delfi.ee> updated for node 6.11.5-LTS |
8 | --- node-v6.11.5/src/node_crypto.cc~ 2017-10-24 22:10:14.000000000 +0300 | |
9 | +++ node-v6.11.5/src/node_crypto.cc 2017-11-02 13:38:45.435760247 +0200 | |
10 | @@ -121,8 +121,6 @@ | |
11 | static Mutex* mutexes; | |
58e86022 | 12 | |
a5a3e195 | 13 | static const char* const root_certs[] = { |
58e86022 | 14 | -#include "node_root_certs.h" // NOLINT(build/include_order) |
a5a3e195 | 15 | -}; |
58e86022 | 16 | |
a5a3e195 ER |
17 | static std::string extra_root_certs_file; // NOLINT(runtime/string) |
18 | ||
19 | @@ -850,24 +848,18 @@ | |
20 | (void) &clear_error_on_return; // Silence compiler warning. | |
58e86022 ER |
21 | |
22 | if (!root_cert_store) { | |
a5a3e195 | 23 | - root_cert_store = NewRootCertStore(); |
58e86022 | 24 | - |
a5a3e195 ER |
25 | - if (!extra_root_certs_file.empty()) { |
26 | - unsigned long err = AddCertsFromFile( // NOLINT(runtime/int) | |
27 | - root_cert_store, | |
28 | - extra_root_certs_file.c_str()); | |
29 | - if (err) { | |
30 | - ProcessEmitWarning(sc->env(), | |
31 | - "Ignoring extra certs from `%s`, load failed: %s\n", | |
32 | - extra_root_certs_file.c_str(), | |
33 | - ERR_error_string(err, nullptr)); | |
58e86022 | 34 | - } |
a5a3e195 ER |
35 | - } |
36 | + if (SSL_CTX_load_verify_locations(sc->ctx_, "/etc/certs/ca-certificates.crt", NULL) == 1) { | |
37 | + root_cert_store = SSL_CTX_get_cert_store(sc->ctx_); | |
38 | + } else { | |
39 | + // new empty store | |
40 | + root_cert_store = NewRootCertStore(); | |
41 | + } | |
42 | + } else { | |
43 | + SSL_CTX_set_cert_store(sc->ctx_, root_cert_store); | |
58e86022 | 44 | } |
3de234b3 | 45 | |
a5a3e195 ER |
46 | // Increment reference count so global store is not deleted along with CTX. |
47 | X509_STORE_up_ref(root_cert_store); | |
48 | - SSL_CTX_set_cert_store(sc->ctx_, root_cert_store); | |
58e86022 | 49 | } |
318ea6db | 50 | |
51 |