mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-28 21:02:25 +01:00
Odd-numbered versions are supported by upstream only for 9 months. Packages in Alpine stable are supported for 2 years, so we should keep only LTS version of Node.js in stable. Therefore the former nodejs package has been renamed to nodejs-current and moved to the community repository, and this one becomes the main nodejs package. See https://github.com/nodejs/LTS#lts-schedule Related to 308944d90df71c773c958a1c5ff4ebdb240526a3
76 lines
2.1 KiB
Diff
76 lines
2.1 KiB
Diff
From: Jakub Jirutka <jakub@jirutka.cz>
|
|
Date: Sat, 26 Nov 2016 01:32:00 +0200
|
|
Subject: Use system-provided CA certificates instead of bundled ones
|
|
|
|
Forwarded: need some feedback before submitting the matter upstream
|
|
Author: Jérémy Lal <kapouer@melix.org>
|
|
Last-Update: 2014-03-02
|
|
|
|
Modified 2014-05-02 by T.C. Hollingsworth <tchollingsworth@gmail.com> with the
|
|
correct path for Fedora
|
|
|
|
Modified 2015-12-01 by Stephen Gallagher <sgallagh@redhat.com> to update for
|
|
Node.js 4.2
|
|
|
|
Modified 2016-03-04 by Stephen Gallagher <sgallagh@redhat.com> to update for
|
|
Node.js 5.4.1
|
|
|
|
Modified 2016-07-26 by Haikel Guemar <hguemar@fedoraproject.org> to update for
|
|
Node.js 4.4.7
|
|
|
|
Modified 2016-11-26 by Jakub Jirutka <jakub@jirutka.cz> for Alpine Linux
|
|
|
|
--- a/src/node_crypto.cc
|
|
+++ b/src/node_crypto.cc
|
|
@@ -192,8 +192,8 @@ static X509_NAME *cnnic_ev_name =
|
|
|
|
static Mutex* mutexes;
|
|
|
|
-const char* const root_certs[] = {
|
|
-#include "node_root_certs.h" // NOLINT(build/include_order)
|
|
+const char* root_certs[] = {
|
|
+ NULL
|
|
};
|
|
|
|
X509_STORE* root_cert_store;
|
|
@@ -847,29 +847,17 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {
|
|
CHECK_EQ(sc->ca_store_, nullptr);
|
|
|
|
if (!root_cert_store) {
|
|
- root_cert_store = X509_STORE_new();
|
|
-
|
|
- for (size_t i = 0; i < arraysize(root_certs); i++) {
|
|
- BIO* bp = NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i]));
|
|
- if (bp == nullptr) {
|
|
- return;
|
|
- }
|
|
-
|
|
- X509 *x509 = PEM_read_bio_X509(bp, nullptr, CryptoPemCallback, nullptr);
|
|
- if (x509 == nullptr) {
|
|
- BIO_free_all(bp);
|
|
- return;
|
|
- }
|
|
-
|
|
- X509_STORE_add_cert(root_cert_store, x509);
|
|
-
|
|
- BIO_free_all(bp);
|
|
- X509_free(x509);
|
|
+ if (SSL_CTX_load_verify_locations(sc->ctx_, "/etc/ssl/certs/ca-certificates.crt", NULL) == 1) {
|
|
+ root_cert_store = SSL_CTX_get_cert_store(sc->ctx_);
|
|
+ } else {
|
|
+ // empty store
|
|
+ root_cert_store = X509_STORE_new();
|
|
}
|
|
+ } else {
|
|
+ SSL_CTX_set_cert_store(sc->ctx_, root_cert_store);
|
|
}
|
|
|
|
sc->ca_store_ = root_cert_store;
|
|
- SSL_CTX_set_cert_store(sc->ctx_, sc->ca_store_);
|
|
}
|
|
|
|
|
|
--
|
|
2.9.0
|
|
|