diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-05-05 12:05:11 +0300 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-05-05 12:05:11 +0300 |
commit | b3bab6daacff9126b194ca78485fdc7073d05a42 (patch) | |
tree | 9739cb49fa8a2b92fdb45c54a26814b7c65f12b2 /src | |
parent | 3dc88589897ea3b08cf1e736e643637eea39264c (diff) | |
download | gnutls-b3bab6daacff9126b194ca78485fdc7073d05a42.tar.gz |
Added --alpn option to cli
Diffstat (limited to 'src')
-rw-r--r-- | src/cli-args.def | 7 | ||||
-rw-r--r-- | src/cli.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/cli-args.def b/src/cli-args.def index 5e663c09df..c6516a7e33 100644 --- a/src/cli-args.def +++ b/src/cli-args.def @@ -258,6 +258,13 @@ flag = { }; flag = { + name = alpn; + arg-type = string; + descrip = "Application layer protocol"; + doc = "This option will set and enable the Application Layer Protocol Negotiation (ALPN) in the TLS protocol."; +}; + +flag = { name = port; value = p; arg-type = string; @@ -662,6 +662,12 @@ init_tls_session (const char *hostname) if (HAVE_OPT(DH_BITS)) gnutls_dh_set_prime_bits( session, OPT_VALUE_DH_BITS); + + if (HAVE_OPT(ALPN)) + { + gnutls_datum_t p = { OPT_ARG(ALPN), strlen(OPT_ARG(ALPN)) }; + gnutls_alpn_set_protocols( session, &p, 1); + } gnutls_credentials_set (session, GNUTLS_CRD_ANON, anon_cred); if (srp_cred) |