lol
1Patch for HTTP::Tiny that defaults verify_SSL to 1
2
3Based on proposed Debian patch by Dominic Hargreaves:
4https://salsa.debian.org/perl-team/interpreter/perl/-/commit/1490431e40e22052f75a0b3449f1f53cbd27ba92
5
6
7diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
8index 5803e4599..88ba51461 100644
9--- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
10+++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
11@@ -40,7 +40,7 @@ sub _croak { require Carp; Carp::croak(@_) }
12 #pod * C<timeout> — Request timeout in seconds (default is 60) If a socket open,
13 #pod read or write takes longer than the timeout, an exception is thrown.
14 #pod * C<verify_SSL> — A boolean that indicates whether to validate the SSL
15-#pod certificate of an C<https> — connection (default is false)
16+#pod certificate of an C<https> — connection (default is true)
17 #pod * C<SSL_options> — A hashref of C<SSL_*> — options to pass through to
18 #pod L<IO::Socket::SSL>
19 #pod
20@@ -112,7 +112,7 @@ sub new {
21 max_redirect => 5,
22 timeout => defined $args{timeout} ? $args{timeout} : 60,
23 keep_alive => 1,
24- verify_SSL => $args{verify_SSL} || $args{verify_ssl} || 0, # no verification by default
25+ verify_SSL => $args{verify_SSL} // $args{verify_ssl} // 1, # verification by default
26 no_proxy => $ENV{no_proxy},
27 };
28
29@@ -1038,7 +1038,7 @@ sub new {
30 timeout => 60,
31 max_line_size => 16384,
32 max_header_lines => 64,
33- verify_SSL => 0,
34+ verify_SSL => 1,
35 SSL_options => {},
36 %args
37 }, $class;
38@@ -1765,7 +1765,7 @@ C<timeout> — Request timeout in seconds (default is 60) If a socket open, read
39
40 =item *
41
42-C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is false)
43+C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is true)
44
45 =item *
46
47@@ -2035,7 +2035,7 @@ Verification of server identity
48
49 =back
50
51-B<By default, HTTP::Tiny does not verify server identity>.
52+B<By default, HTTP::Tiny in NixOS verifies server identity>.
53
54 Server identity verification is controversial and potentially tricky because it
55 depends on a (usually paid) third-party Certificate Authority (CA) trust model
56@@ -2043,16 +2043,14 @@ to validate a certificate as legitimate. This discriminates against servers
57 with self-signed certificates or certificates signed by free, community-driven
58 CA's such as L<CAcert.org|http://cacert.org>.
59
60-By default, HTTP::Tiny does not make any assumptions about your trust model,
61-threat level or risk tolerance. It just aims to give you an encrypted channel
62-when you need one.
63-
64 Setting the C<verify_SSL> attribute to a true value will make HTTP::Tiny verify
65 that an SSL connection has a valid SSL certificate corresponding to the host
66 name of the connection and that the SSL certificate has been verified by a CA.
67 Assuming you trust the CA, this will protect against a L<man-in-the-middle
68-attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>. If you are
69-concerned about security, you should enable this option.
70+attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>.
71+
72+If you are not concerned about security, and this default in NixOS causes
73+problems, you should disable this option.
74
75 Certificate verification requires a file containing trusted CA certificates.
76
77--
78
79