lib/r7_insight/host/connection.rb in r7insight-3.0.1 vs lib/r7_insight/host/connection.rb in r7insight-3.0.2
- old
+ new
@@ -187,10 +187,11 @@
ssl_context = OpenSSL::SSL::SSLContext.new
ssl_context.cert_store = cert_store
ssl_context.min_version = OpenSSL::SSL::TLS1_1_VERSION
- ssl_context.max_version = OpenSSL::SSL::TLS1_3_VERSION
+ # For older versions of openssl (prior to 1.1.1) missing support for TLSv1.3
+ ssl_context.max_version = defined?(OpenSSL::SSL::TLS1_3_VERSION) ? OpenSSL::SSL::TLS1_3_VERSION : OpenSSL::SSL::TLS1_2_VERSION
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
ssl_socket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)
ssl_socket.hostname = host if ssl_socket.respond_to?(:hostname=)
ssl_socket.sync_close = true
Timeout.timeout(10) do