diff options
-rwxr-xr-x | bollux | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bollux b/bollux index 0bb7391..3664714 100755 --- a/bollux +++ b/bollux | |||
@@ -305,14 +305,13 @@ request_url() { | |||
305 | local url="$3" | 305 | local url="$3" |
306 | 306 | ||
307 | # support for TLS v1.3 and v1.2 | 307 | # support for TLS v1.3 and v1.2 |
308 | ssl_cmd_tls1_2=(openssl s_client -tls1_2 -crlf -quiet -connect "$server:$port") | 308 | ssl_cmd=(openssl s_client -crlf -quiet -connect "$server:$port") |
309 | ssl_cmd_tls1_3=(openssl s_client -tls1_3 -crlf -quiet -connect "$server:$port") | 309 | ssl_cmd+=(-servername "$server") # SNI |
310 | 310 | ssl_cmd_tls1_2=("${ssl_cmd[@]}" -tls1_2) | |
311 | ssl_cmd_tls1_2+=(-servername "$server") # SNI | 311 | ssl_cmd_tls1_3=("${ssl_cmd[@]}" -tls1_3) |
312 | ssl_cmd_tls1_3+=(-servername "$server") # SNI | ||
313 | 312 | ||
314 | # always try to connect with TLS v1.3 first | 313 | # always try to connect with TLS v1.3 first |
315 | run "${ssl_cmd_tls1_3[@]}" <<<"$url" 2>/dev/null || run "${ssl_cmd_tls1_2[@]}" <<< "$url" 2>/dev/null | 314 | run "${ssl_cmd_tls1_3[@]}" <<<"$url" 2>/dev/null || run "${ssl_cmd_tls1_2[@]}" <<<"$url" 2>/dev/null |
316 | } | 315 | } |
317 | 316 | ||
318 | handle_response() { | 317 | handle_response() { |