summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorSteven Collison <steven@raycoll.com>2022-06-18 08:26:20 -0700
committerPauli <pauli@openssl.org>2022-10-04 15:01:36 +1100
commit511c49189ef600d41f44cd7c5d204e9ea27b5f48 (patch)
tree30fc8762b31c3291fdd77a8ffd1210d7109fc21d /apps
parent8c7d847e2e6ac6bfded210c19fd8461254bb2be3 (diff)
downloadopenssl-new-511c49189ef600d41f44cd7c5d204e9ea27b5f48.tar.gz
s_client: Support interactive reconnect command
This change adds the 'C' command character to allow a user to drop the current session and reconnect to the server. It has the same behavior as the `-reconnect` option except this allows reconnect to be triggered at an arbitrary point in the session. The primary use case for this change is to provide a way for the user to probe a server for TLS1.3 session resumption support. This is not currently reliably supported by the `-reconnect` option. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18683)
Diffstat (limited to 'apps')
-rw-r--r--apps/s_client.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index 1ed5f753e6..0b8805a652 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -3081,6 +3081,16 @@ int s_client_main(int argc, char **argv)
goto shut;
}
+ if ((!c_ign_eof) && ((i <= 0) || (cbuf[0] == 'C' && cmdletters))) {
+ cbuf_len = 0;
+ BIO_printf(bio_c_out,
+ "RECONNECTING\n");
+ do_ssl_shutdown(con);
+ SSL_set_connect_state(con);
+ BIO_closesocket(SSL_get_fd(con));
+ goto re_start;
+ }
+
if ((!c_ign_eof) && (cbuf[0] == 'R' && cmdletters)) {
BIO_printf(bio_err, "RENEGOTIATING\n");
SSL_renegotiate(con);