[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
329/376: Add option to disable binary cache certificate checking
From: |
Ludovic Courtès |
Subject: |
329/376: Add option to disable binary cache certificate checking |
Date: |
Wed, 28 Jan 2015 22:05:57 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit d44d923be971a9f9a05b156e20fe2b26151826a9
Author: Eelco Dolstra <address@hidden>
Date: Tue Dec 9 13:15:31 2014 +0100
Add option to disable binary cache certificate checking
---
doc/manual/command-ref/conf-file.xml | 9 +++++++++
scripts/download-from-binary-cache.pl.in | 8 +++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/doc/manual/command-ref/conf-file.xml
b/doc/manual/command-ref/conf-file.xml
index 930ed77..053f4d4 100644
--- a/doc/manual/command-ref/conf-file.xml
+++ b/doc/manual/command-ref/conf-file.xml
@@ -402,6 +402,15 @@ flag, e.g. <literal>--option gc-keep-outputs
false</literal>.</para>
</varlistentry>
+ <varlistentry><term><literal>verify-https-binary-caches</literal></term>
+
+ <listitem><para>Whether HTTPS binary caches are required to have a
+ certificate that can be verified. Defaults to
+ <literal>true</literal>.</para></listitem>
+
+ </varlistentry>
+
+
<varlistentry><term><literal>force-manifest</literal></term>
<listitem><para>If this option is set to <literal>false</literal>
diff --git a/scripts/download-from-binary-cache.pl.in
b/scripts/download-from-binary-cache.pl.in
index db030c1..0e640ee 100644
--- a/scripts/download-from-binary-cache.pl.in
+++ b/scripts/download-from-binary-cache.pl.in
@@ -47,7 +47,12 @@ $caBundle = "/etc/ssl/certs/ca-certificates.crt" if
!$caBundle && -f "/etc/ssl/c
my $userName = getpwuid($<) || $ENV{"USER"} or die "cannot figure out user
name";
-my $requireSignedBinaryCaches = ($Nix::Config::config{"signed-binary-caches"}
// "0") ne "0";
+sub isTrue {
+ my ($x) = @_;
+ return $x eq "true" || $x eq "1";
+}
+
+my $requireSignedBinaryCaches =
isTrue($Nix::Config::config{"signed-binary-caches"} // "0");
my $curlConnectTimeout = int(
$Nix::Config::config{"untrusted-connect-timeout"} //
@@ -69,6 +74,7 @@ sub addRequest {
$curl->setopt(CURLOPT_WRITEDATA, $fh);
$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
$curl->setopt(CURLOPT_CAINFO, $caBundle) if defined $caBundle;
+ $curl->setopt(CURLOPT_SSL_VERIFYPEER, 0) unless
isTrue($Nix::Config::config{"verify-https-binary-caches"} // "1");
$curl->setopt(CURLOPT_USERAGENT, "Nix/$Nix::Config::version");
$curl->setopt(CURLOPT_NOBODY, 1) if $head;
$curl->setopt(CURLOPT_FAILONERROR, 1);
- 315/376: Make all ExternalValueBase functions const, (continued)
- 315/376: Make all ExternalValueBase functions const, Ludovic Courtès, 2015/01/28
- 318/376: Shut up a warning, Ludovic Courtès, 2015/01/28
- 317/376: Fix another operator precedence issue found by Perl 5.20, Ludovic Courtès, 2015/01/28
- 322/376: Remove Fedora 18, 19 builds, Ludovic Courtès, 2015/01/28
- 319/376: Use posix_spawn to run the pager, Ludovic Courtès, 2015/01/28
- 321/376: Remove some platforms with too-old compilers, Ludovic Courtès, 2015/01/28
- 323/376: Explicitly include required C headers, Ludovic Courtès, 2015/01/28
- 316/376: Merge pull request #401 from shlevy/external-value, Ludovic Courtès, 2015/01/28
- 314/376: Allow external code using libnixexpr to add types, Ludovic Courtès, 2015/01/28
- 328/376: Provide some fallback defaults for the CA bundle, Ludovic Courtès, 2015/01/28
- 329/376: Add option to disable binary cache certificate checking,
Ludovic Courtès <=
- 330/376: Doh, Ludovic Courtès, 2015/01/28
- 327/376: Use https://cache.nixos.org instead of http://cache.nixos.org, Ludovic Courtès, 2015/01/28
- 331/376: Fix bad comment, Ludovic Courtès, 2015/01/28
- 320/376: Define ‘environ’, Ludovic Courtès, 2015/01/28
- 333/376: builtins.readFile: realise context associated with the path, Ludovic Courtès, 2015/01/28
- 332/376: Always use https to fetch the Nixpkgs channel, Ludovic Courtès, 2015/01/28
- 326/376: Link against perl.dll on Cygwin, Ludovic Courtès, 2015/01/28
- 324/376: Set custom compiler flags on Cygwin, Ludovic Courtès, 2015/01/28
- 325/376: Fix library handling on Cygwin, Ludovic Courtès, 2015/01/28
- 335/376: Don't use RPATH on Darwin, Ludovic Courtès, 2015/01/28