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.

47 lines
1.1 KiB

  1. --- a/openssl.c
  2. +++ b/openssl.c
  3. @@ -174,7 +174,9 @@ ssl_init(void)
  4. {
  5. verbose = value("verbose") != NULL;
  6. if (initialized == 0) {
  7. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  8. SSL_library_init();
  9. +#endif
  10. initialized = 1;
  11. }
  12. if (rand_init == 0)
  13. @@ -215,12 +217,13 @@ ssl_verify_cb(int success, X509_STORE_CT
  14. static const SSL_METHOD *
  15. ssl_select_method(const char *uhp)
  16. {
  17. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  18. const SSL_METHOD *method;
  19. char *cp;
  20. cp = ssl_method_string(uhp);
  21. if (cp != NULL) {
  22. -#if !defined(OPENSSL_NO_SSL2) && !OPENSSL_VERSION_NUMBER >= 0x10100000L
  23. +#ifndef OPENSSL_NO_SSL2
  24. if (equal(cp, "ssl2"))
  25. method = SSLv2_client_method();
  26. else
  27. @@ -240,6 +243,9 @@ ssl_select_method(const char *uhp)
  28. } else
  29. method = SSLv23_client_method();
  30. return method;
  31. +#else
  32. + return TLS_client_method();
  33. +#endif
  34. }
  35. static void
  36. @@ -427,7 +433,9 @@ ssl_gen_err(const char *fmt, ...)
  37. va_start(ap, fmt);
  38. vfprintf(stderr, fmt, ap);
  39. va_end(ap);
  40. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  41. SSL_load_error_strings();
  42. +#endif
  43. fprintf(stderr, ": %s\n",
  44. (ERR_error_string(ERR_get_error(), NULL)));
  45. }