aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/tls_client.cpp11
-rw-r--r--src/tls/tls_client.h1
2 files changed, 7 insertions, 5 deletions
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp
index 8a7492d8e..1fd4e0383 100644
--- a/src/tls/tls_client.cpp
+++ b/src/tls/tls_client.cpp
@@ -39,7 +39,8 @@ Client::Client(std::function<void (const byte[], size_t)> output_fn,
const std::string srp_identifier = m_creds.srp_identifier("tls-client", m_hostname);
- initiate_handshake(false, srp_identifier, next_protocol);
+ const Protocol_Version version = m_policy.pref_version();
+ initiate_handshake(false, version, srp_identifier, next_protocol);
}
Handshake_State* Client::new_handshake_state()
@@ -58,10 +59,13 @@ void Client::renegotiate(bool force_full_renegotiation)
delete m_state;
- initiate_handshake(force_full_renegotiation);
+ const Protocol_Version version = m_reader.get_version();
+
+ initiate_handshake(force_full_renegotiation, version);
}
void Client::initiate_handshake(bool force_full_renegotiation,
+ Protocol_Version version,
const std::string& srp_identifier,
std::function<std::string (std::vector<std::string>)> next_protocol)
{
@@ -93,9 +97,6 @@ void Client::initiate_handshake(bool force_full_renegotiation,
}
}
- const Protocol_Version version = m_reader.get_version().valid() ?
- m_reader.get_version() : m_policy.pref_version();
-
if(!m_state->client_hello) // not resuming
{
m_state->client_hello = new Client_Hello(
diff --git a/src/tls/tls_client.h b/src/tls/tls_client.h
index f8af662d3..a803df32d 100644
--- a/src/tls/tls_client.h
+++ b/src/tls/tls_client.h
@@ -69,6 +69,7 @@ class BOTAN_DLL Client : public Channel
void renegotiate(bool force_full_renegotiation = false) override;
private:
void initiate_handshake(bool force_full_renegotiation,
+ Protocol_Version version,
const std::string& srp_identifier = "",
std::function<std::string (std::vector<std::string>)> next_protocol =
std::function<std::string (std::vector<std::string>)>());