Last active
February 21, 2019 13:03
-
-
Save fnnzzz/c554ca9acf03add1d76106eadcaabd23 to your computer and use it in GitHub Desktop.
rua cert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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