From c8b7f5eb0663ffdecffb9179db5636cd6116f3e1 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 30 Mar 2010 20:11:24 +0000 Subject: Present requested hostname (SNI extn) to TLS_Server user --- src/ssl/tls_server.cpp | 2 ++ src/ssl/tls_server.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/ssl/tls_server.cpp b/src/ssl/tls_server.cpp index 82f90036d..47902a71c 100644 --- a/src/ssl/tls_server.cpp +++ b/src/ssl/tls_server.cpp @@ -343,6 +343,8 @@ void TLS_Server::process_handshake_msg(Handshake_Type type, state->client_hello = new Client_Hello(contents); + client_requested_hostname = state->client_hello->hostname(); + state->version = choose_version(state->client_hello->version(), policy->min_version()); diff --git a/src/ssl/tls_server.h b/src/ssl/tls_server.h index 3f4ff6473..5cf830a64 100644 --- a/src/ssl/tls_server.h +++ b/src/ssl/tls_server.h @@ -26,6 +26,9 @@ class BOTAN_DLL TLS_Server : public TLS_Connection std::vector peer_cert_chain() const; + std::string requested_hostname() const + { return client_requested_hostname; } + void close(); bool is_closed() const; @@ -63,6 +66,7 @@ class BOTAN_DLL TLS_Server : public TLS_Connection SecureVector session_id; SecureQueue read_buf; std::string peer_id; + std::string client_requested_hostname; bool active; }; -- cgit v1.2.3