summary refs log tree commit diff
path: root/pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch
diff options
context:
space:
mode:
authorTyson Whitehead <twhitehead@gmail.com>2018-06-29 16:29:22 -0400
committerTyson Whitehead <twhitehead@gmail.com>2018-06-29 16:29:22 -0400
commit321f13427c72d8b3ced02aa316c390d8b0bd962a (patch)
tree9a4e016a569698001f4ce924b588a9af3e6b95d1 /pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch
parent9037f608ae6cee590cb6a1eeda612ce43c36f7f8 (diff)
downloadnixpkgs-321f13427c72d8b3ced02aa316c390d8b0bd962a.tar
nixpkgs-321f13427c72d8b3ced02aa316c390d8b0bd962a.tar.gz
nixpkgs-321f13427c72d8b3ced02aa316c390d8b0bd962a.tar.bz2
nixpkgs-321f13427c72d8b3ced02aa316c390d8b0bd962a.tar.lz
nixpkgs-321f13427c72d8b3ced02aa316c390d8b0bd962a.tar.xz
nixpkgs-321f13427c72d8b3ced02aa316c390d8b0bd962a.tar.zst
nixpkgs-321f13427c72d8b3ced02aa316c390d8b0bd962a.zip
lwp-protocol-https: honour NIX_SSL_CERT_FILE
Diffstat (limited to 'pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch')
-rw-r--r--pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch32
1 files changed, 24 insertions, 8 deletions
diff --git a/pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch b/pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch
index 119c8b61da3..e9b501c29e2 100644
--- a/pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch
+++ b/pkgs/development/perl-modules/lwp-protocol-https-cert-file.patch
@@ -1,15 +1,31 @@
-diff -ru -x '*~' LWP-Protocol-https-6.04-orig/lib/LWP/Protocol/https.pm LWP-Protocol-https-6.04/lib/LWP/Protocol/https.pm
---- LWP-Protocol-https-6.04-orig/lib/LWP/Protocol/https.pm	2013-04-29 23:16:18.000000000 +0200
-+++ LWP-Protocol-https-6.04/lib/LWP/Protocol/https.pm	2016-03-02 14:59:01.639844511 +0100
-@@ -24,6 +24,11 @@
+From 321401098f2c86a6f68e186cfc06e030b09484b6 Mon Sep 17 00:00:00 2001
+From: Tyson Whitehead <twhitehead@gmail.com>
+Date: Fri, 29 Jun 2018 15:47:00 -0400
+Subject: [PATCH] Respect NIX_SSL_CERT_FILE and SSL_CERT_FILE (in that order)
+
+---
+ lib/LWP/Protocol/https.pm | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/lib/LWP/Protocol/https.pm b/lib/LWP/Protocol/https.pm
+index f7230e2..c78b9ce 100644
+--- a/lib/LWP/Protocol/https.pm
++++ b/lib/LWP/Protocol/https.pm
+@@ -23,6 +23,14 @@ sub _extra_sock_opts
+ 	$ssl_opts{SSL_verify_mode} = 0;
      }
      if ($ssl_opts{SSL_verify_mode}) {
- 	unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
-+	    $ssl_opts{SSL_ca_file} = $ENV{'SSL_CERT_FILE'};
++	unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
++	    $ssl_opts{SSL_ca_file} = $ENV{'NIX_SSL_CERT_FILE'}
++                if !defined $ssl_opts{SSL_ca_file};
++	    $ssl_opts{SSL_ca_file} = $ENV{'SSL_CERT_FILE'}
++                if !defined $ssl_opts{SSL_ca_file};
 +	    $ssl_opts{SSL_ca_file} = "/etc/ssl/certs/ca-certificates.crt"
 +		if !defined $ssl_opts{SSL_ca_file} && -e "/etc/ssl/certs/ca-certificates.crt";
 +	}
-+	unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
+ 	unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
  	    eval {
  		require Mozilla::CA;
- 	    };
+-- 
+2.14.0
+