Bug 55674

Summary: Ошибки проверки сертификатов при скачивании каналов или кэша при первом использовании
Product: Sisyphus Reporter: Egor Zakharov <egzakharovich>
Component: nixAssignee: boria138 <boria138>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: major    
Priority: P5 CC: boria138
Version: unstable   
Hardware: x86_64   
OS: Linux   

Description Egor Zakharov 2025-08-20 21:01:53 MSK
Где-то в системе определяется переменная $NIX_SSL_CERT_FILE, я не смог разобраться, где именно.

Она указывает на файл /etc/ssl/certs/ca-certificates.crt

Который является симлинком на /etc/pki/tls/certs/ca-bundle.trust.crt

Однако проверка сертификатов при использовании SSL проваливается и возникает ошибка, почти на любом действии:

warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL peer certificate or SSH remote key was not OK (60) server verification failed: certificate signer not trusted. (CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none); retrying in 270 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL peer certificate or SSH remote key was not OK (60) server verification failed: certificate signer not trusted. (CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none); retrying in 576 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL peer certificate or SSH remote key was not OK (60) server verification failed: certificate signer not trusted. (CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none); retrying in 1042 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL peer certificate or SSH remote key was not OK (60) server verification failed: certificate signer not trusted. (CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none); retrying in 2160 ms
warning: unable to download 'https://cache.nixos.org/nix-cache-info': SSL peer certificate or SSH remote key was not OK (60) server verification failed: certificate signer not trusted. (CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none)

Экспериментальным путём выяснил, что nix не нравится формат файла CAFile

А конкретно -----BEGIN TRUSTED CERTIFICATE-----

Если указать на файл /etc/pki/tls/certs/ca-bundle.crt в конфигурации или через переменную окружения, то всё работает. Потому что этот файл использует формат -----BEGIN CERTIFICATE-----

Соответственно, нужно либо переопределить переменную NIX_SSL_CERT_FILE в системе или добавить строчку "ssl-cert-file = /etc/pki/tls/certs/ca-bundle.crt" в /etc/nix/nix.conf
Comment 1 Repository Robot 2025-08-25 11:23:54 MSK
nix-2.30.2-alt1 -> sisyphus:

Mon Aug 25 2025 Boris Yumankulov <boria138@altlinux> 2.30.2-alt1
- new version 2.30.2
- fix ssl patch (ALT bug: 55674)