81
/* fatal error occured */
83
/* fatal error occurred */
82
84
if (error == GNUTLS_E_FATAL_ALERT_RECEIVED) {
83
85
i_warning("Received SSL fatal alert: %s [%s]",
84
86
get_alert_text(proxy),
298
300
gnutls_compression_set_priority(session, comp_priority);
299
301
gnutls_kx_set_priority(session, kx_priority);
300
302
gnutls_mac_set_priority(session, mac_priority);
301
gnutls_cert_type_set_priority(session, cert_type_priority);
303
gnutls_certificate_type_set_priority(session, cert_type_priority);
303
305
gnutls_cred_set(session, GNUTLS_CRD_CERTIFICATE, x509_cred);
505
509
read_parameters(paramfile);
507
if ((ret = gnutls_certificate_allocate_cred(&x509_cred)) < 0) {
508
i_fatal("gnutls_certificate_allocate_cred() failed: %s",
511
if ((ret = gnutls_certificate_allocate_credentials(&x509_cred)) < 0) {
512
i_fatal("gnutls_certificate_allocate_credentials() failed: %s",
509
513
gnutls_strerror(ret));
516
520
certfile, keyfile, gnutls_strerror(ret));
519
ret = gnutls_certificate_set_dh_params(x509_cred, dh_params);
521
i_fatal("Can't set DH parameters: %s", gnutls_strerror(ret));
522
ret = gnutls_certificate_set_rsa_params(x509_cred, rsa_params);
524
i_fatal("Can't set RSA parameters: %s", gnutls_strerror(ret));
523
gnutls_certificate_set_dh_params(x509_cred, dh_params);
524
gnutls_certificate_set_rsa_export_params(x509_cred, rsa_params);
526
526
ssl_proxies = hash_create(default_pool, default_pool, 0, NULL, NULL);
527
527
ssl_initialized = TRUE;
530
static void ssl_proxy_destroy_hash(void *key __attr_unused__, void *value,
531
void *context __attr_unused__)
533
ssl_proxy_destroy(value);
536
530
void ssl_proxy_deinit(void)
532
struct hash_iterate_context *iter;
538
535
if (!ssl_initialized)
541
hash_foreach(ssl_proxies, ssl_proxy_destroy_hash, NULL);
538
iter = hash_iterate_init(ssl_proxies);
539
while (hash_iterate(iter, &key, &value))
540
ssl_proxy_destroy(value);
541
hash_iterate_deinit(iter);
542
542
hash_destroy(ssl_proxies);
544
gnutls_certificate_free_cred(x509_cred);
544
gnutls_certificate_free_credentials(x509_cred);
545
545
gnutls_global_deinit();