aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/tls_server.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-03-20 04:32:15 +0000
committerlloyd <[email protected]>2015-03-20 04:32:15 +0000
commitb01ce65e09e50ec624bdbf62bf2c1433f0d6f637 (patch)
tree8aa46632eb381b44de64d106b62f8efad49c173d /src/cmd/tls_server.cpp
parent181e75b66d5fbffdce04d37014c260b4fab5dec8 (diff)
Add ALPN (RFC 7301) and remove NPN
Diffstat (limited to 'src/cmd/tls_server.cpp')
-rw-r--r--src/cmd/tls_server.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/cmd/tls_server.cpp b/src/cmd/tls_server.cpp
index fc8499be1..ee72ba5ac 100644
--- a/src/cmd/tls_server.cpp
+++ b/src/cmd/tls_server.cpp
@@ -146,12 +146,11 @@ int tls_server(int argc, char* argv[])
Basic_Credentials_Manager creds(rng, server_crt, server_key);
- /*
- * These are the protocols we advertise to the client, but the
- * client will send back whatever it actually plans on talking,
- * which may or may not take into account what we advertise.
- */
- const std::vector<std::string> protocols = { "echo/1.0", "echo/1.1" };
+ auto protocol_chooser = [](const std::vector<std::string>& protocols) -> std::string {
+ for(size_t i = 0; i != protocols.size(); ++i)
+ std::cout << "Client offered protocol " << i << " = " << protocols[i] << "\n";
+ return "echo/1.0"; // too bad
+ };
std::cout << "Listening for new connections on " << transport << " port " << port << "\n";
@@ -210,7 +209,7 @@ int tls_server(int argc, char* argv[])
creds,
policy,
rng,
- protocols,
+ protocol_chooser,
!is_tcp);
while(!server.is_closed())