From 05d29e973175889685a695d34cf810992497b316 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 31 Oct 2014 10:18:47 +0000 Subject: Add TLS fallback signalling (draft-ietf-tls-downgrade-scsv-00) --- src/cmd/tls_client.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/cmd') diff --git a/src/cmd/tls_client.cpp b/src/cmd/tls_client.cpp index 18b8044b5..9130cd085 100644 --- a/src/cmd/tls_client.cpp +++ b/src/cmd/tls_client.cpp @@ -158,7 +158,7 @@ int tls_client_main(int argc, char* argv[]) std::string host = argv[1]; u32bit port = argc >= 3 ? Botan::to_u32bit(argv[2]) : 443; - std::string transport = argc >= 4 ? argv[3] : "tcp"; + const std::string transport = argc >= 4 ? argv[3] : "tcp"; int sockfd = connect_to_host(host, port, transport); @@ -167,10 +167,7 @@ int tls_client_main(int argc, char* argv[]) std::bind(stream_socket_write, sockfd, _1, _2) : std::bind(dgram_socket_write, sockfd, _1, _2); - auto version = - (transport == "tcp") ? - TLS::Protocol_Version::latest_tls_version() : - TLS::Protocol_Version::latest_dtls_version(); + auto version = policy.latest_supported_version(transport != "tcp"); TLS::Client client(socket_write, process_data, -- cgit v1.2.3