3 @@ -698,8 +698,10 @@ dtls dtls_create(uint16_t port)
6 _ssl_initialized = true;
7 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
8 SSL_load_error_strings();
14 @@ -711,9 +713,9 @@ dtls dtls_create(uint16_t port)
17 #ifdef USE_ONE_CONTEXT
18 - SSL_CTX *ctx = SSL_CTX_new(DTLSv1_method());
19 + SSL_CTX *ctx = SSL_CTX_new(DTLS_method());
21 - SSL_CTX *ctx = SSL_CTX_new(DTLSv1_server_method());
22 + SSL_CTX *ctx = SSL_CTX_new(DTLS_server_method());
23 #endif /* USE_ONE_CONTEXT */
26 @@ -1002,6 +1004,7 @@ _client_psk(SSL *ssl,
28 bool dtls_set_psk(dtls d, const char *psk, size_t psk_len)
30 +#ifndef OPENSSL_NO_PSK
32 d->psk = malloc(psk_len);
34 @@ -1011,6 +1014,9 @@ bool dtls_set_psk(dtls d, const char *psk, size_t psk_len)
35 SSL_CTX_set_psk_client_callback(d->ssl_client_ctx, _client_psk);
36 SSL_CTX_set_psk_server_callback(d->ssl_server_ctx, _server_psk);
43 bool dtls_cert_to_pem_buf(dtls_cert cert, char *buf, int buf_len)