Skip to content

Commit 272c61d

Browse files
committed
fix tls_options on nil input
1 parent d88eb77 commit 272c61d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/github/ldap.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def capabilities
245245
def check_encryption(encryption, tls_options = {})
246246
return unless encryption
247247

248+
tls_options ||= {}
248249
case encryption.downcase.to_sym
249250
when :ssl, :simple_tls
250251
{ method: :simple_tls, tls_options: tls_options }

test/ldap_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def test_tls_validation
4545
@ldap.check_encryption(:tls, verify_mode: OpenSSL::SSL::VERIFY_NONE))
4646
assert_equal({ method: :start_tls, tls_options: { cert_store: "some/path" } },
4747
@ldap.check_encryption(:tls, cert_store: "some/path"))
48+
assert_equal({ method: :start_tls, tls_options: {} },
49+
@ldap.check_encryption(:tls, nil))
4850
end
4951

5052
def test_search_delegator

0 commit comments

Comments
 (0)