static int ssl_socket_close (CONNECTION * conn);
static int tls_close (CONNECTION* conn);
static void ssl_err (sslsockdata *data, int err);
+static void ssl_dprint_err_stack (void);
static int ssl_cache_trusted_cert (X509 *cert);
static int ssl_check_certificate (CONNECTION *conn, sslsockdata * data);
static int interactive_check_cert (X509 *cert, int idx, int len);
if (! (data->ctx = SSL_CTX_new (SSLv23_client_method ())))
{
+ /* L10N: an SSL context is a data structure returned by the OpenSSL
+ * function SSL_CTX_new(). In this case it returned NULL: an
+ * error condition.
+ */
+ mutt_error (_("Unable to create SSL context"));
+ ssl_dprint_err_stack ();
mutt_socket_close (conn);
return -1;
}
dprint (1, (debugfile, "SSL error: %s\n", errmsg));
}
+static void ssl_dprint_err_stack (void)
+{
+#ifdef DEBUG
+ BIO *bio;
+ char *buf = NULL;
+
+ if (! (bio = BIO_new (BIO_s_mem ())))
+ return;
+ ERR_print_errors (bio);
+ if (BIO_get_mem_data (bio, &buf))
+ dprint (1, (debugfile, "SSL error stack: %s\n", buf));
+ BIO_free (bio);
+#endif
+}
+
+
static char *x509_get_part (char *line, const char *ndx)
{
static char ret[SHORT_STRING];