aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls/tls_client.cpp')
-rw-r--r--src/tls/tls_client.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp
index db967cee3..2915fc68d 100644
--- a/src/tls/tls_client.cpp
+++ b/src/tls/tls_client.cpp
@@ -35,7 +35,7 @@ Client::Client(std::function<void (const byte[], size_t)> output_fn,
{
m_writer.set_version(Protocol_Version::SSL_V3);
- m_state = new Handshake_State(new Stream_Handshake_Reader);
+ m_state = new_handshake_state();
m_state->set_expected_next(SERVER_HELLO);
m_state->client_npn_cb = next_protocol;
@@ -82,6 +82,11 @@ Client::Client(std::function<void (const byte[], size_t)> output_fn,
m_secure_renegotiation.update(m_state->client_hello);
}
+Handshake_State* Client::new_handshake_state() const
+ {
+ return new Handshake_State(new Stream_Handshake_Reader);
+ }
+
/*
* Send a new client hello to renegotiate
*/
@@ -91,7 +96,7 @@ void Client::renegotiate(bool force_full_renegotiation)
return; // currently in active handshake
delete m_state;
- m_state = new Handshake_State(new Stream_Handshake_Reader);
+ m_state = new_handshake_state();
m_state->set_expected_next(SERVER_HELLO);