Skip to content

Instantly share code, notes, and snippets.

@fnnzzz
Last active February 21, 2019 13:03
Show Gist options
  • Save fnnzzz/c554ca9acf03add1d76106eadcaabd23 to your computer and use it in GitHub Desktop.
Save fnnzzz/c554ca9acf03add1d76106eadcaabd23 to your computer and use it in GitHub Desktop.
rua cert
CREATE NEW:
New-SelfSignedCertificate -NotAfter (Get-Date).AddYears(10) -DnsName '*.mac.rabota.ua', 'mac.rabota.ua' -CertStoreLocation Cert:\LocalMachine\My
ADD TO TRUST:
$req = [Net.WebRequest]::Create('https://dev.rabota.ua/')
try { $req.GetResponse() } catch {}
$cert = $req.ServicePoint.Certificate
$bytes = $cert.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)
$target = "$([Environment]::GetFolderPath('Desktop'))\cert.cer"
Set-Content -Value $bytes -Encoding Byte -Path $target
Import-Certificate -FilePath $target -CertStoreLocation Cert:\LocalMachine\Root
Remove-Item $target
PAUSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment