Dynamically choose the correct TLS version