question

$$ANON_USER$$ avatar image
0 Votes"
$$ANON_USER$$ asked IanXue-MSFT commented

How can I use TLS 1.3 with Invoke-RestMethod?

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?



windows-server-powershell
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The handshake works correctly if I configure Tomcat to use TLS 1.2
I am using latest Powershell 7.1.1 with supports TLS 1.3

0 Votes 0 ·

It seems that Windows 10 does not yet support TLS 1.3 in its stack as of today

0 Votes 0 ·

What is the value returned by [Net.ServicePointManager]::SecurityProtocol ?

0 Votes 0 ·

It returns Tls13 but according to this post my version of Windows (Version 2004, Build 19041) does not yet support it as build 20170 is required


0 Votes 0 ·

Sorry I'm not sure if TLS 1.3 is supported in Build 19041. You can start a new thread on this with the "windows-10-general" tag.

0 Votes 0 ·

0 Answers