When I call
Invoke-RestMethod -Method POST -Uri $url -Body $Body -Headers $Header …
I get:
Authentication failed because the remote party sent a TLS alert: 'ProtocolVersion'.
Server is Tomcat 9 with just TLS 1.3 enabled while Powershell uses TLS 1.2 - I've checked with Wireshark:
TLSv1.2 Record Layer: Handshake Protocol: Client Hello
Content Type: Handshake (22)
Version: TLS 1.2 (0x0303)
Length: 167
Handshake Protocol: Client Hello
I then set
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13
But I get the same error: Powershell still sends a TLS 1.2 Client Hello
How can I use TLS 1.3 from my Powershell scripts?