Skip to content

Instantly share code, notes, and snippets.

@Indigenuity
Created April 12, 2023 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Indigenuity/aa53158555ca826e6568822adcbf7d65 to your computer and use it in GitHub Desktop.
Save Indigenuity/aa53158555ca826e6568822adcbf7d65 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
response_code=$(curl -s -o /dev/null -w "%{http_code}" https://tls-check.hazardhub.com)
error_code=$?
if [[ $error_code -eq 35 ]]; then
echo "Your client may not support TLS 1.2 or higher. Check with guides for your operating system for update procedures"
elif [[ $response_code -ne 200 ]]; then
echo "Got unexpected response code: $response_code, with curl error code: $error_code"
echo "This script only knows how to check for TLS compatibility, it looks like you've encountered a different problem"
else
echo "Success! Your client supports TLS 1.2 or higher."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment