Merge pull request #3 from alagoutte/gnutls
Fix build when use old GnuTLS release (< 3.1) FossilOrigin-Name: 141e606f8216f459814350606f11b8071f7e1dc9dd9f521e6d125e663401a6fc
This commit is contained in:
commit
e4019e7a26
@ -117,7 +117,11 @@ struct dtls_gnutls_data *dtls_gnutls_data_create(struct conn *conn,int config)
|
||||
|
||||
|
||||
int bits;
|
||||
#if GNUTLS_VERSION_NUMBER >= 0x030100
|
||||
bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_INSECURE);
|
||||
#elseif
|
||||
bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_WEAK);
|
||||
#endif
|
||||
/* Generate Diffie-Hellman parameters - for use with DHE
|
||||
* kx algorithms. When short bit length is used, it might
|
||||
* be wise to regenerate parameters often.
|
||||
|
@ -17,9 +17,11 @@ int dtls_gnutls_connect(struct conn *conn)
|
||||
d = dtls_gnutls_data_create(conn,GNUTLS_CLIENT | GNUTLS_DATAGRAM | GNUTLS_NONBLOCK);
|
||||
|
||||
// gnutls_dh_set_prime_bits(d->session, 512);
|
||||
gnutls_handshake_set_timeout(d->session,GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
|
||||
#if GNUTLS_VERSION_NUMBER >= 0x030100
|
||||
gnutls_handshake_set_timeout(d->session,GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
|
||||
|
||||
gnutls_dtls_set_data_mtu(d->session,1500);
|
||||
#endif
|
||||
gnutls_dtls_set_mtu(d->session,1500);
|
||||
|
||||
int rc;
|
||||
|
Loading…
Reference in New Issue
Block a user