Skip to content

Instantly share code, notes, and snippets.

@newyear2006
Created January 4, 2014 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newyear2006/8257555 to your computer and use it in GitHub Desktop.
Save newyear2006/8257555 to your computer and use it in GitHub Desktop.
$conn = New-Object system.net.sockets.tcpclient($host, $port)
$stream = New-Object system.net.security.sslstream($conn.getstream(), $null, {
Write-Host $args[2].ChainElements[0].Certificate.Subject;
Write-Host "PolicyErrors: $($args[3])";
})
$result = $stream.authenticateasclient("chocolatey.org")
$conn.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment