Skip to content

Commit ec7b5dc

Browse files
committed
Merge pull request #176 from ruby-ldap/fix-nil-tls-options
Fix nil :tls_options
2 parents fd2d1ed + f8987cb commit ec7b5dc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/net/ldap/connection.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def self.wrap_with_ssl(io, tls_options = {})
8989
# generously contributing the :start_tls path.
9090
#++
9191
def setup_encryption(args)
92+
args[:tls_options] ||= {}
9293
case args[:method]
9394
when :simple_tls
9495
@conn = self.class.wrap_with_ssl(@conn, args[:tls_options])

test/test_ldap_connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_queued_read_setup_encryption_with_start_tls
202202
and_return(result2)
203203
mock.should_receive(:write)
204204
conn = Net::LDAP::Connection.new(:socket => mock)
205-
flexmock(Net::LDAP::Connection).should_receive(:wrap_with_ssl).with(mock, nil).
205+
flexmock(Net::LDAP::Connection).should_receive(:wrap_with_ssl).with(mock, {}).
206206
and_return(mock)
207207

208208
conn.next_msgid # simulates ongoing query

0 commit comments

Comments
 (0)