r = gnutls_certificate_allocate_credentials(&manager->dnstls_data.cert_cred);
if (r < 0)
- return -ENOMEM;
+ return log_warning_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to allocate SSL credentials: %s",
+ gnutls_strerror(r));
r = gnutls_certificate_set_x509_system_trust(manager->dnstls_data.cert_cred);
if (r < 0)
manager->dnstls_data.ctx = SSL_CTX_new(TLS_client_method());
if (!manager->dnstls_data.ctx)
- return -ENOMEM;
+ return log_warning_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to create SSL context: %s",
+ ERR_error_string(ERR_get_error(), NULL));
r = SSL_CTX_set_min_proto_version(manager->dnstls_data.ctx, TLS1_2_VERSION);
if (r == 0)
- return -EIO;
+ return log_warning_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to set protocol version on SSL context: %s",
+ ERR_error_string(ERR_get_error(), NULL));
(void) SSL_CTX_set_options(manager->dnstls_data.ctx, SSL_OP_NO_COMPRESSION);
return log_warning_errno(SYNTHETIC_ERRNO(EIO),
"Failed to load system trust store: %s",
ERR_error_string(ERR_get_error(), NULL));
-
return 0;
}