211 |
gnutls_certificate_allocate_credentials(&x509_cred); |
gnutls_certificate_allocate_credentials(&x509_cred); |
212 |
atexit(_tls_cleanup_x509); |
atexit(_tls_cleanup_x509); |
213 |
if (secure.cafile) { |
if (secure.cafile) { |
214 |
gnutls_certificate_set_x509_trust_file(x509_cred, |
rs = gnutls_certificate_set_x509_trust_file(xcred, |
215 |
secure.cafile, |
secure.cafile, |
216 |
GNUTLS_X509_FMT_PEM); |
GNUTLS_X509_FMT_PEM); |
217 |
|
if (rs < 0) { |
218 |
|
anubis_error(HARD, _("TLS Error reading `%s': %s"), |
219 |
|
secure.cafile, |
220 |
|
gnutls_strerror(rs)); |
221 |
|
return 0; |
222 |
|
} |
223 |
} |
} |
224 |
gnutls_certificate_set_x509_key_file(x509_cred, |
gnutls_certificate_set_x509_key_file(x509_cred, |
225 |
secure.cert, secure.key, |
secure.cert, secure.key, |
229 |
gnutls_certificate_set_dh_params(x509_cred, dh_params); |
gnutls_certificate_set_dh_params(x509_cred, dh_params); |
230 |
|
|
231 |
session = initialize_tls_session(); |
session = initialize_tls_session(); |
232 |
|
|
233 |
gnutls_transport_set_ptr(session, sd_client); |
gnutls_transport_set_ptr(session, sd_client); |
234 |
rs = gnutls_handshake(session); |
rs = gnutls_handshake(session); |
235 |
if (rs < 0) { |
if (rs < 0) { |
423 |
#endif /* HAVE_TLS */ |
#endif /* HAVE_TLS */ |
424 |
|
|
425 |
/* EOF */ |
/* EOF */ |
|
|
|