Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.24k stars 436 forks source link

How to force using TLS 1.2 when the server supports both TLS 1.2 and TLS 1.3 while using a client-certificate? #1276

Open janouwehand opened 3 months ago

janouwehand commented 3 months ago

Hi. I am using vscode+rest-client to connect to my server API which runs on IIS on Windows Sever 2022. For authentication a client certificate is used:

  "rest-client.certificates": {
        "domain.com": {
            "pfx": "C:\\Temp\\cer\\nextgenapi-usercert\\info@domain.com_out.pfx",
            "passphrase": "....."
        }
    },

My request is:

GET https://domain.com/api/v1-cs/metadata/tables
X-Api-Key: "JMAV...."

When I connect I get a 'read ECONNRESET' error, which I also get using Postman when it (automatically) uses TLS 1.3. However, when I change the setting for the request to TLS 1.2 the call works fine in Postman. How can I change such a setting for rest-client so that it forces the use of TLS 1.2, even though the server also supports TLS 1.3? Note that the passphrase is correct as I tested this by successfully importing the PFX using that phrase, and, of course, using Postman. Happy to hear from you!