В Сhrome (и практически всех chrome-подобных браузерах) достаточно давно есть политика CACertificatesWithConstraints, которая, в том числе, позволяет доверять конкретному корневому сертификату только для фиксированного списка доменов. Сам сертификат при этом не требуется размещать в системном корневом хранилище. Это актуально для текущих проблем с отзывами сертификатов и переходом банков на корневой Минцифры https://habr.com/en/news/1066284/
Ниже простой powershell скрипт для винды и ungoogled-chromium, в котором необходимо указать:
1) CertPath — полный локальный путь к сертификату Минцифры (нужен файл russian_trusted_root_ca.cer из архива https://gu-st.ru/content/lending/android_russian_trusted_root_ca.zip)
2) PermittedDnsNames — массив доменов, для которых сертификат Минцифры разрешён как корневой. Удобно, что политика влияет сразу и на все поддомены указанного домена.
3) PolicyKey — путь к ветке политик. В примере — путь для chromium, для chrome он, предположительно, HKLM:\SOFTWARE\Policies\Google\Chrome\CACertificatesWithConstraints
#requires -RunAsAdministrator$CertPath = '.\russian_trusted_root_ca.cer'$PermittedDnsNames = @('alfabank.ru', 'vtb.ru')$PolicyKey = 'HKLM:\SOFTWARE\Policies\Chromium\CACertificatesWithConstraints'# --- 1. Load cert and emit single-line base64 (handles both PEM and DER input) ---$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new($CertPath)$b64 = [Convert]::ToBase64String($cert.RawData)Write-Host "Subject : $($cert.Subject)"Write-Host "Issuer : $($cert.Issuer)"Write-Host "Expires : $($cert.NotAfter)"if ($cert.Subject -ne $cert.Issuer) { Write-Warning "Subject != Issuer - this is not a self-signed root. Confirm it's the intended trust anchor."}# --- 2. Build the policy entry JSON ---$obj = [ordered]@{ certificate = $b64 constraints = [ordered]@{ permitted_dns_names = @($PermittedDnsNames) }}$entry = $obj | ConvertTo-Json -Compress -Depth 5# Guard against PowerShell collapsing a single-element array into a scalarif ($PermittedDnsNames.Count -eq 1 -and $entry -notmatch '"permitted_dns_names":\[') { $entry = $entry -replace '"permitted_dns_names":("[^"]*")', '"permitted_dns_names":[$1]'}# --- 3. Write it ---New-Item -Path $PolicyKey -Force | Out-NullGet-Item $PolicyKey | Select-Object -ExpandProperty Property | ForEach-Object { Remove-ItemProperty -Path $PolicyKey -Name $_ } # clear stale entriesNew-ItemProperty -Path $PolicyKey -Name '1' -Value $entry -PropertyType String -Force | Out-NullWrite-Host "`nWrote to $PolicyKey value '1':"Write-Host $entry
После прогона скрипта, достаточно сделать Reload policies в chrome://policy/ и убедиться, что политика появилась со статусом OK.
ссылка на оригинал статьи https://habr.com/ru/articles/1066372/