mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Merge pull request #12322 from DeterminateSystems/fix-fetchurl-test
Fix fetchurl test
This commit is contained in:
commit
b8c296f0de
1 changed files with 2 additions and 2 deletions
|
@ -22,7 +22,7 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "nss-preload";
|
name = "fetchurl";
|
||||||
|
|
||||||
nodes = {
|
nodes = {
|
||||||
machine = { pkgs, ... }: {
|
machine = { pkgs, ... }: {
|
||||||
|
@ -76,7 +76,7 @@ in
|
||||||
# Fetching from a server with an untrusted cert should fail.
|
# Fetching from a server with an untrusted cert should fail.
|
||||||
err = machine.fail("nix build --no-substitute --expr 'import <nix/fetchurl.nix> { url = \"https://bad/index.html\"; hash = \"sha256-rsBwZF/lPuOzdjBZN2E08FjMM3JHyXit0Xi2zN+wAZ8=\"; }' 2>&1")
|
err = machine.fail("nix build --no-substitute --expr 'import <nix/fetchurl.nix> { url = \"https://bad/index.html\"; hash = \"sha256-rsBwZF/lPuOzdjBZN2E08FjMM3JHyXit0Xi2zN+wAZ8=\"; }' 2>&1")
|
||||||
print(err)
|
print(err)
|
||||||
assert "SSL certificate problem: self-signed certificate" in err
|
assert "SSL peer certificate or SSH remote key was not OK" in err
|
||||||
|
|
||||||
# Fetching from a server with a trusted cert should work via environment variable override.
|
# Fetching from a server with a trusted cert should work via environment variable override.
|
||||||
machine.succeed("NIX_SSL_CERT_FILE=/tmp/cafile.pem nix build --no-substitute --expr 'import <nix/fetchurl.nix> { url = \"https://bad/index.html\"; hash = \"sha256-rsBwZF/lPuOzdjBZN2E08FjMM3JHyXit0Xi2zN+wAZ8=\"; }'")
|
machine.succeed("NIX_SSL_CERT_FILE=/tmp/cafile.pem nix build --no-substitute --expr 'import <nix/fetchurl.nix> { url = \"https://bad/index.html\"; hash = \"sha256-rsBwZF/lPuOzdjBZN2E08FjMM3JHyXit0Xi2zN+wAZ8=\"; }'")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue