Curl – Test TLS and HTTP versions

To test TLS versions and HTTP versions using CURL, you can specify the desired TLS and HTTP versions using the appropriate command-line options. Here’s how you can do it:

Testing TLS Versions:
To test different TLS versions, you can use the `–tlsv1.0`, `–tlsv1.1`, `–tlsv1.2`, or `–tlsv1.3` options with CURL. Here’s an example command to test TLS 1.2:

curl --tlsv1.2 https://cordero.me

This command sends an HTTPS request to `cordero.me` using TLS 1.2. You can replace `cordero.me` with the URL you want to test.

Testing HTTP Versions:
To test different HTTP versions, you can use the `–http1.0`, `–http1.1`, or `–http2` options with CURL. Here’s an example command to test HTTP/1.1:

curl --http1.1 http://cordero.me

This command sends an HTTP/1.1 request to `cordero.me`. You can replace `cordero.me` with the URL you want to test.

It’s important to note that the availability of specific TLS and HTTP versions depends on the CURL version and the underlying system libraries. Ensure that your CURL version supports the desired versions you want to test.

Additionally, some servers may have restrictions or configurations that enforce specific TLS or HTTP versions, which may override the options specified in CURL.

Note: this could be helpful when creating firewall rules and you need to test the versions.