You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. From 652dd89d297df2dbf7fc7a235d5305b5fc945e2f Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Sun, 25 Nov 2018 19:09:33 -0800
  4. Subject: [PATCH] Fix compilation under OpenSSL 1.1 without deprecated APIs
  5. ---
  6. ssl.c | 4 ++++
  7. ssl.h | 2 ++
  8. 2 files changed, 6 insertions(+)
  9. --- a/ssl.c
  10. +++ b/ssl.c
  11. @@ -359,7 +359,9 @@ static SSL_CTX *ssl_create_context(char
  12. debug("continuing anyway...");
  13. }
  14. }
  15. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  16. SSL_CTX_set_tmp_rsa_callback(ssl_context, ssl_temp_rsa_cb);
  17. +#endif
  18. SSL_CTX_set_info_callback(ssl_context, ssl_info_cb);
  19. SSL_CTX_set_tlsext_status_cb(ssl_context, ssl_stapling_cb);
  20. SSL_CTX_set_tlsext_servername_callback(ssl_context, ssl_sni_cb);
  21. @@ -405,8 +407,10 @@ static SSL_CTX *ssl_create_context(char
  22. int ssl_init(void)
  23. {
  24. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  25. SSL_load_error_strings();
  26. SSLeay_add_ssl_algorithms();
  27. +#endif
  28. ssl_context = ssl_create_context(keyfile, certfile, cacert_dir, cacert_file);
  29. if (ssl_context == NULL) {
  30. error("Unable to create default context");
  31. --- a/ssl.h
  32. +++ b/ssl.h
  33. @@ -1,6 +1,8 @@
  34. #ifdef HAVE_LIBSSL
  35. #include <openssl/ssl.h>
  36. #include <openssl/err.h>
  37. +#include <openssl/bn.h>
  38. +#include <openssl/rsa.h>
  39. #define SRV_SSL_V23 0
  40. #define SRV_SSL_V2 1