aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/tls_client.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-04-20 21:53:20 +0000
committerlloyd <[email protected]>2012-04-20 21:53:20 +0000
commitbf3f967353053ce408f3bbee58d183487e569f7e (patch)
treead11eb9977064e0e8dde8b733e706ddf64a68dea /doc/examples/tls_client.cpp
parent0adad7dd2c6def13fbb5677d7bcc859ba4cab0b1 (diff)
Various hacks for testing client auth, SRP, etc
Diffstat (limited to 'doc/examples/tls_client.cpp')
-rw-r--r--doc/examples/tls_client.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/examples/tls_client.cpp b/doc/examples/tls_client.cpp
index d0a354e66..a787af1fe 100644
--- a/doc/examples/tls_client.cpp
+++ b/doc/examples/tls_client.cpp
@@ -188,7 +188,16 @@ void doit(RandomNumberGenerator& rng,
continue;
}
- client.send(buf, got);
+ if(got == 2 && (buf[0] == 'R' || buf[0] == 'r') && buf[1] == '\n')
+ {
+ std::cout << "Client initiated renegotiation\n";
+ client.renegotiate((buf[0] == 'R'));
+ }
+
+ if(buf[0] == 'H')
+ client.heartbeat(&buf[1], got-1);
+ else
+ client.send(buf, got);
}
}