none
Getting thumprint from certificate of any URL RRS feed

  • Question

  • Using web-request, I am trying to etch information about website certificates.

    $url = "https://google.com"
    $webRequest = [Net.WebRequest]::Create("$url")
    try { $webRequest.GetResponse() } catch {}
    $cert = $webRequest.ServicePoint.Certificate

    I am getting information about the certificate.

    But for the URL, in which certificate is not trusted, how we can get the certificate information using PowerShell. As, when I try the same URL using chrome, I am getting warning but still can access the certificate information

    Thursday, November 1, 2018 4:49 PM

All replies

  • A quick Google search came back with many results, what about this one below?

    https://gist.github.com/jstangroome/5945820


    Thursday, November 1, 2018 5:16 PM
  • getting error .

    Exception calling "AuthenticateAsClient" with "1" argument(s): "Authentication failed because the remote party has closed the transport stream."

    At line:22 char:12

    +            $SslStream.AuthenticateAsClient('')

    +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

        + FullyQualifiedErrorId : IOException

    Thursday, November 1, 2018 5:35 PM