openssl3.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
  2. index 8c04cb5..132d803 100644
  3. --- a/ext/openssl/extconf.rb
  4. +++ b/ext/openssl/extconf.rb
  5. @@ -104,6 +104,9 @@
  6. have_func("SSLv2_method")
  7. have_func("SSLv2_server_method")
  8. have_func("SSLv2_client_method")
  9. +have_func("SSLv3_method")
  10. +have_func("SSLv3_server_method")
  11. +have_func("SSLv3_client_method")
  12. have_func("TLSv1_1_method")
  13. have_func("TLSv1_1_server_method")
  14. have_func("TLSv1_1_client_method")
  15. diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
  16. index f7cb7f0..47111f6 100644
  17. --- a/ext/openssl/ossl_ssl.c
  18. +++ b/ext/openssl/ossl_ssl.c
  19. @@ -109,9 +109,12 @@ static const struct {
  20. OSSL_SSL_METHOD_ENTRY(SSLv2_server),
  21. OSSL_SSL_METHOD_ENTRY(SSLv2_client),
  22. #endif
  23. +#if defined(HAVE_SSLV3_METHOD) && defined(HAVE_SSLV3_SERVER_METHOD) && \
  24. + defined(HAVE_SSLV3_CLIENT_METHOD)
  25. OSSL_SSL_METHOD_ENTRY(SSLv3),
  26. OSSL_SSL_METHOD_ENTRY(SSLv3_server),
  27. OSSL_SSL_METHOD_ENTRY(SSLv3_client),
  28. +#endif
  29. OSSL_SSL_METHOD_ENTRY(SSLv23),
  30. OSSL_SSL_METHOD_ENTRY(SSLv23_server),
  31. OSSL_SSL_METHOD_ENTRY(SSLv23_client),
  32. diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
  33. index 07e081b..0cbfcba 100644
  34. --- a/test/openssl/test_ssl.rb
  35. +++ b/test/openssl/test_ssl.rb
  36. @@ -912,7 +912,7 @@ def test_unset_OP_ALL
  37. # that has been marked as forbidden, therefore either of these may be raised
  38. HANDSHAKE_ERRORS = [OpenSSL::SSL::SSLError, Errno::ECONNRESET]
  39. -if OpenSSL::SSL::SSLContext::METHODS.include? :TLSv1
  40. +if OpenSSL::SSL::SSLContext::METHODS.include?(:TLSv1) && OpenSSL::SSL::SSLContext::METHODS.include?(:SSLv3)
  41. def test_forbid_ssl_v3_for_client
  42. ctx_proc = Proc.new { |ctx| ctx.options = OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_SSLv3 }