Skip to content

Commit

Permalink
RUBY-1470 Enable SNI on jruby where possible (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
p-mongo authored and p committed Sep 24, 2018
1 parent 28fec0c commit e7421ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/reference/driver-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,15 @@ Language Compatibility
-
- |checkmark|

Atlas Compatibility
~~~~~~~~~~~~~~~~~~~

`Driver version 2.6.1 <https://github.com/mongodb/mongo-ruby-driver/releases/tag/v2.6.1>`_
or higher is recommended when using MongoDB Atlas, as this version has
significant SSL performance improvements.

When running on JRuby and connecting to Atlas Free Tier,
`driver version 2.6.3 <https://github.com/mongodb/mongo-ruby-driver/releases/tag/v2.6.3>`_
or higher and Java 8 or higher are required.

.. include:: /includes/unicode-checkmark.rst
2 changes: 1 addition & 1 deletion lib/mongo/socket/ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def connect!(connect_timeout = nil)
Timeout.timeout(connect_timeout, Error::SocketTimeoutError) do
handle_errors { @tcp_socket.connect(::Socket.pack_sockaddr_in(port, host)) }
@socket = OpenSSL::SSL::SSLSocket.new(@tcp_socket, context)
@socket.hostname = @host_name unless BSON::Environment.jruby?
@socket.hostname = @host_name
@socket.sync_close = true
handle_errors { @socket.connect }
verify_certificate!(@socket)
Expand Down

0 comments on commit e7421ba

Please sign in to comment.