PowerShell Genie

REST call returns certificate or TLS errors

Incident 2 min read Troubleshooting walkthrough

Documentation: Microsoft Learn

Work the problem

The TCP port is open

Fictional case: Port 443 accepts a connection, but the HTTPS request reports a certificate-name mismatch.

Which check follows from that error?

Reasoning notebook

Record the evidence that supports your answer and the check you would run next. Your notes stay in this browser — nothing is uploaded.

Why it happens

An HTTPS connection must negotiate TLS and validate the server certificate before the HTTP operation can complete. Name mismatch, expiration, trust-chain problems, protocol negotiation and proxy interception are different failure paths. Windows PowerShell 5.1 behavior depends on its .NET and operating-system configuration; do not assume every 5.1 host always negotiates an obsolete protocol.

Check this first

1PS> Invoke-WebRequest $Uri -Method Head -Verbose

What to look for

The TCP path works. The TLS identity check fails, so investigate the hostname, presented certificate and any proxy interception.

Working through it

Read the exact TLS or certificate error. Compare the requested hostname, presented certificate, expiry and trust chain, including any approved proxy. Use the method supported by the endpoint; a rejected HEAD request is not necessarily a TLS problem.

Correct the endpoint certificate, approved trust deployment or platform protocol configuration indicated by the evidence. Keep certificate validation enabled during the final test.

Avoiding it next time

Verify the repair: Repeat the request with normal certificate validation enabled and verify the intended endpoint identity.

Primary documentation

PowerShell errors and debugging documentation

Genie guideREST call returns certificate or TLS errors

Start with the symptom, then inspect the checks and evidence. These are investigation steps; more than one cause may fit.