summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2013-04-06 15:50:12 +0100
committerDr. Stephen Henson <steve@openssl.org>2013-04-09 14:02:48 +0100
commitc6913eeb762edffddecaaba5c84909d7a7962927 (patch)
treea57c3c33e23b846852f00ec4681c6fdeccf8ea85 /apps
parent04638f2fc335a6dc2af8e5d556d36e29c261dcd2 (diff)
Dual DTLS version methods.
Add new methods DTLS_*_method() which support both DTLS 1.0 and DTLS 1.2 and pick the highest version the peer supports during negotiation. As with SSL/TLS options can change this behaviour specifically SSL_OP_NO_DTLSv1 and SSL_OP_NO_DTLSv1_2.
Diffstat (limited to 'apps')
-rw-r--r--apps/s_client.c5
-rw-r--r--apps/s_server.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index d09d6951a4..45f6ced044 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -881,6 +881,11 @@ static char *jpake_secret = NULL;
meth=TLSv1_client_method();
#endif
#ifndef OPENSSL_NO_DTLS1
+ else if (strcmp(*argv,"-dtls") == 0)
+ {
+ meth=DTLS_client_method();
+ socket_type=SOCK_DGRAM;
+ }
else if (strcmp(*argv,"-dtls1") == 0)
{
meth=DTLSv1_client_method();
diff --git a/apps/s_server.c b/apps/s_server.c
index 3eaee82c78..657b042d07 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -1362,6 +1362,11 @@ int MAIN(int argc, char *argv[])
{ meth=TLSv1_2_server_method(); }
#endif
#ifndef OPENSSL_NO_DTLS1
+ else if (strcmp(*argv,"-dtls") == 0)
+ {
+ meth=DTLS_server_method();
+ socket_type = SOCK_DGRAM;
+ }
else if (strcmp(*argv,"-dtls1") == 0)
{
meth=DTLSv1_server_method();