about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xbollux12
1 files changed, 9 insertions, 3 deletions
diff --git a/bollux b/bollux index 68eade9..0bb7391 100755 --- a/bollux +++ b/bollux
@@ -304,9 +304,15 @@ request_url() {
304 local port="$2" 304 local port="$2"
305 local url="$3" 305 local url="$3"
306 306
307 ssl_cmd=(openssl s_client -crlf -quiet -connect "$server:$port") 307 # support for TLS v1.3 and v1.2
308 ssl_cmd+=(-servername "$server") # SNI 308 ssl_cmd_tls1_2=(openssl s_client -tls1_2 -crlf -quiet -connect "$server:$port")
309 run "${ssl_cmd[@]}" <<<"$url" 2>/dev/null 309 ssl_cmd_tls1_3=(openssl s_client -tls1_3 -crlf -quiet -connect "$server:$port")
310
311 ssl_cmd_tls1_2+=(-servername "$server") # SNI
312 ssl_cmd_tls1_3+=(-servername "$server") # SNI
313
314 # 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
310} 316}
311 317
312handle_response() { 318handle_response() {