Skip to content

Commit

Permalink
Merge pull request #24203 from layus/nix-ssl-cert-file
Browse files Browse the repository at this point in the history
git, curl, openssl: Refactor $NIX_SSL_CERT_FILE handling
  • Loading branch information
adrianpk committed Mar 22, 2017
2 parents fc79f17 + 84f9676 commit 34cc444
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ stdenv.mkDerivation {
./symlinks-in-bin.patch
./git-sh-i18n.patch
./ssh-path.patch
./ssl-cert-file.patch
];

postPatch = ''
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion pkgs/development/libraries/openssl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ let
patches =
(args.patches or [])
++ [ ./nix-ssl-cert-file.patch ]
++ optional (versionOlder version "1.1.0") ./use-etc-ssl-certs.patch
++ optional (versionOlder version "1.1.0")
(if stdenv.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch)
++ optional stdenv.isCygwin ./1.0.1-cygwin64.patch
++ optional
(versionOlder version "1.0.2" && (stdenv.isDarwin || (stdenv ? cross && stdenv.cross.libc == "libSystem")))
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/libraries/openssl/use-etc-ssl-certs-darwin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff -ru -x '*~' openssl-1.0.1r-orig/crypto/cryptlib.h openssl-1.0.1r/crypto/cryptlib.h
--- openssl-1.0.1r-orig/crypto/cryptlib.h 2016-01-28 14:38:30.000000000 +0100
+++ openssl-1.0.1r/crypto/cryptlib.h 2016-02-03 12:54:29.193165176 +0100
@@ -81,8 +81,8 @@

# ifndef OPENSSL_SYS_VMS
# define X509_CERT_AREA OPENSSLDIR
# define X509_CERT_DIR OPENSSLDIR "/certs"
-# define X509_CERT_FILE OPENSSLDIR "/cert.pem"
+# define X509_CERT_FILE "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
# define X509_PRIVATE_DIR OPENSSLDIR "/private"
# else
# define X509_CERT_AREA "SSLROOT:[000000]"
6 changes: 1 addition & 5 deletions pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ stdenv.mkDerivation rec {
sha256 = "1s1hyndva0yp62xy96pcp4anzrvw6cl0abjajim17sbmdp00fwhw";
};

patches = [ ./nix-ssl-cert-file.patch ];

outputs = [ "bin" "dev" "out" "man" "devdoc" ];

enableParallelBuilding = true;
Expand Down Expand Up @@ -57,9 +55,7 @@ stdenv.mkDerivation rec {
'';

configureFlags = [
# OS X does not have a default system bundle, so we assume cacerts is installed in the default nix-env profile
# This sucks. We should probably just include the latest cacerts in the darwin bootstrap.
"--with-ca-bundle=${if stdenv.isDarwin then "/nix/var/nix/profiles/default" else ""}/etc/ssl/certs/ca-${if stdenv.isDarwin then "bundle" else "certificates"}.crt"
"--with-ca-fallback"
"--disable-manual"
( if sslSupport then "--with-ssl=${openssl.dev}" else "--without-ssl" )
( if gnutlsSupport then "--with-gnutls=${gnutls.dev}" else "--without-gnutls" )
Expand Down
14 changes: 0 additions & 14 deletions pkgs/tools/networking/curl/nix-ssl-cert-file.patch

This file was deleted.

0 comments on commit 34cc444

Please sign in to comment.