summaryrefslogtreecommitdiff
path: root/security/pulledpork/files/patch-pulledpork.pl
blob: 4581d5db7a432db73151173114ba13eb822c4234 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- pulledpork.pl.orig	2020-09-01 15:08:32 UTC
+++ pulledpork.pl
@@ -91,9 +91,24 @@ if ($oSystem =~ /freebsd/i) {
             exit(1);
         }
     }
+    elsif (-e "/usr/local/share/certs/ca-root-nss.crt") {
+        $CAFile = "/usr/local/share/certs/ca-root-nss.crt";
+        if (-r $CAFile) {
+            $ua->ssl_opts(SSL_ca_file => $CAFile);
+        }
+        else {
+            carp "ERROR: $CAFile is not readable by "
+                . (getpwuid($<))[0] . "\n";
+            syslogit('err|local0',
+                "FATAL: ERROR: $CAFile is not readable by "
+                    . (getpwuid($<))[0] . "\n")
+                if $Syslogging;
+            exit(1);
+        }
+    }
     else {
         carp
-            "ERROR: cert file does not exist (/etc/ssl/cert.pem or /usr/local/etc/ssl/cert.pem) Ensure that the ca_root_nss port/pkg is installed, or use -w to skip SSL verification\n";
+            "ERROR: cert file does not exist (/etc/ssl/cert.pem, /usr/local/etc/ssl/cert.pem or /usr/local/share/certs/ca-root-nss.crt) Ensure that the ca_root_nss port/pkg is installed, or use -w to skip SSL verification\n";
         syslogit('err|local0',
             "FATAL: cert file does not exist. Ensure that the ca_root_nss port/pkg is installed, or use -w to skip SSL verification\n"
         ) if $Syslogging;