Description: do not bundle CA certificates, openssl on Debian have them
As a consequence, nodejs must depend on ca-certificates.
-Forwarded: need some feedback before submitting the matter upstream
+Forwarded: https://github.com/nodejs/node/issues/3159
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 2014-08-11 by Elan Ruusamäe <glen@delfi.ee> with the correct path for PLD
Modified 2015-10-17 by Elan Ruusamäe <glen@delfi.ee> updated for node 4.2.1-LTS
---- node-v4.2.1/src/node_crypto.cc 2015-10-17 15:14:47.248709690 +0300
-+++ node-v4.2.1/src/node_crypto.cc 2015-10-17 15:21:21.109176336 +0300
-@@ -127,7 +127,6 @@
+--- nodejs-4.5.0/src/node_crypto.cc.orig 2016-08-16 17:09:50.000000000 +0200
++++ nodejs-4.5.0/src/node_crypto.cc 2016-09-09 23:40:11.959456422 +0200
+@@ -117,7 +117,6 @@
static uv_mutex_t* locks;
const char* const root_certs[] = {
};
X509_STORE* root_cert_store;
-@@ -706,32 +705,17 @@
+@@ -754,29 +753,18 @@
CHECK_EQ(sc->ca_store_, nullptr);
if (!root_cert_store) {
- root_cert_store = X509_STORE_new();
-
-- for (size_t i = 0; i < ARRAY_SIZE(root_certs); i++) {
-- BIO* bp = NodeBIO::New();
--
-- if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) {
-- BIO_free_all(bp);
+- 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;
+ if (SSL_CTX_load_verify_locations(sc->ctx_, "/etc/certs/ca-certificates.crt", NULL) == 1) {
+ root_cert_store = SSL_CTX_get_cert_store(sc->ctx_);
+ } else {
-+ // empty store
++ // new 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_);
}
+
+
%define node_module_version 46
Summary: Asynchronous JavaScript Engine
Name: nodejs
-# 4.2.x is LTS
-Version: 4.2.6
+# 4.5.0 is LTS
+Version: 4.5.0
Release: 1
License: BSD and MIT and Apache v2.0 and GPL v3
Group: Development/Languages
Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
-# Source0-md5: b1287c356e904954da7e0c6435ff9948
+# Source0-md5: 1885586b4b8a2263f77dce27855661e9
Patch1: %{name}-shared.patch
# force node to use /usr/lib/node as the systemwide module directory
Patch2: %{name}-libpath.patch
Patch5: uv-fpic.patch
URL: https://nodejs.org/
BuildRequires: gcc >= 5:4.0
-BuildRequires: http-parser-devel >= 2.5.0
+BuildRequires: http-parser-devel >= 2.7.0
BuildRequires: libstdc++-devel
%{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
BuildRequires: openssl-devel >= 1.0.1
BuildRequires: pkgconfig
-BuildRequires: python >= 1:2.5.2
+BuildRequires: python >= 2.7
BuildRequires: python-jsmin
BuildRequires: python-modules
BuildRequires: rpm >= 4.4.9-56
# install documentation
install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
-rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
+rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.md
rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
%clean