tls: add DTLS 1.2 support

This commit is contained in:
Richard Aas 2015-02-19 08:22:43 +00:00
parent 047724c38c
commit 761d3714ff
2 changed files with 15 additions and 0 deletions

View file

@ -15,6 +15,8 @@ struct udp_sock;
enum tls_method {
TLS_METHOD_SSLV23,
TLS_METHOD_DTLSV1,
TLS_METHOD_DTLS, /* DTLS 1.0 and 1.2 */
TLS_METHOD_DTLSV1_2, /* DTLS 1.2 */
};
enum tls_fingerprint {

View file

@ -97,6 +97,19 @@ int tls_alloc(struct tls **tlsp, enum tls_method method, const char *keyfile,
case TLS_METHOD_DTLSV1:
tls->ctx = SSL_CTX_new(DTLSv1_method());
break;
#ifdef SSL_OP_NO_DTLSv1_2
/* DTLS v1.2 is available in OpenSSL 1.0.2 and later */
case TLS_METHOD_DTLS:
tls->ctx = SSL_CTX_new(DTLS_method());
break;
case TLS_METHOD_DTLSV1_2:
tls->ctx = SSL_CTX_new(DTLSv1_2_method());
break;
#endif
#endif
default: