Files
nats-server/test/configs/certs/tlsauth/certstore/import-p12-server.ps1
Daniel ModlerandNeil Twigg 289430f52c Certstore: Added cert_match_skip_invalid option
Replaces #4384.

Co-authored-by: Daniel Modler <[email protected]>
Co-authored-by: Neil Twigg <[email protected]>
Signed-off-by: Neil Twigg <[email protected]>
2024-10-29 17:55:03 +00:00

8 lines
429 B
PowerShell

$file=$args[0]
if (!$file) { $file="server.p12 "}
$fileLocale = $PSScriptRoot + "\" + $file
echo "Installing certificate $fileLocale"
$Pass = ConvertTo-SecureString -String 's3cr3t' -Force -AsPlainText
$User = "whatever"
$Cred = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $Pass
Import-PfxCertificate -FilePath $filelocale -CertStoreLocation Cert:\CurrentUser\My -Password $Cred.Password