0001-Produce-more-useful-Invalid-peer-certificate-error-m.patch 930 B

12345678910111213141516171819202122232425262728293031323334353637
  1. From 16a657b2626a66d15fc4c35041cd30f94ed4d17d Mon Sep 17 00:00:00 2001
  2. From: Luke Shumaker <lukeshu@lukeshu.com>
  3. Date: Tue, 21 Nov 2017 11:42:54 -0500
  4. Subject: [PATCH 1/1] Produce more useful "Invalid peer certificate" error
  5. messages
  6. ---
  7. smtp.c | 5 ++++-
  8. 1 file changed, 4 insertions(+), 1 deletion(-)
  9. diff --git a/smtp.c b/smtp.c
  10. index 796578d..00cf066 100644
  11. --- a/smtp.c
  12. +++ b/smtp.c
  13. @@ -18,6 +18,7 @@
  14. #include <pwd.h>
  15. #include <unistd.h>
  16. +#include <openssl/ssl.h>
  17. #include <auth-client.h>
  18. #include <libesmtp.h>
  19. @@ -210,7 +211,9 @@ static void event_cb (smtp_session_t session, int event_no, void *arg, ...)
  20. long result = va_arg (ap, long);
  21. int *ok = va_arg (ap, int *);
  22. - fprintf(stderr, "Invalid peer certificate (error %ld)\n", result);
  23. + fprintf(stderr, "Invalid peer certificate (error %ld: %s)\n",
  24. + result,
  25. + X509_verify_cert_error_string(result));
  26. *ok = 0;
  27. break;
  28. --
  29. 2.15.0