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.

43 lines
1.3 KiB

  1. diff --git a/src/gssl/gssl_openssl.cpp b/src/gssl/gssl_openssl.cpp
  2. index 0e9b73b..49927db 100644
  3. --- a/src/gssl/gssl_openssl.cpp
  4. +++ b/src/gssl/gssl_openssl.cpp
  5. @@ -52,10 +52,14 @@ GSsl::OpenSSL::LibraryImp::LibraryImp( G::StringArray & library_config , Library
  6. m_verbose(verbose) ,
  7. m_config(library_config)
  8. {
  9. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  10. SSL_load_error_strings() ;
  11. SSL_library_init() ;
  12. - int rc = RAND_status() ; G_IGNORE_VARIABLE(rc) ;
  13. OpenSSL_add_all_digests() ;
  14. +#else
  15. + OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL) ;
  16. +#endif
  17. + int rc = RAND_status() ; G_IGNORE_VARIABLE(rc) ;
  18. // allocate a slot for a pointer from SSL to ProtocolImp
  19. m_index = SSL_get_ex_new_index( 0 , nullptr , nullptr , nullptr , nullptr ) ;
  20. @@ -73,15 +77,21 @@ GSsl::OpenSSL::LibraryImp::~LibraryImp()
  21. void GSsl::OpenSSL::LibraryImp::cleanup()
  22. {
  23. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  24. // ffs...
  25. ERR_free_strings() ;
  26. RAND_cleanup() ;
  27. - CRYPTO_cleanup_all_ex_data();
  28. + CRYPTO_cleanup_all_ex_data() ;
  29. +#endif
  30. }
  31. std::string GSsl::OpenSSL::LibraryImp::sid()
  32. {
  33. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  34. return G::Str::printable( SSLeay_version(SSLEAY_VERSION) ) ;
  35. +#else
  36. + return G::Str::printable( OpenSSL_version(OPENSSL_VERSION) ) ;
  37. +#endif
  38. }
  39. std::string GSsl::OpenSSL::LibraryImp::id() const