Skip to content

Commit

Permalink
Fix change top-level macro check to responds_to?
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Nov 11, 2024
1 parent 32e41c2 commit 0ede31e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/std/openssl/ssl/context_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ describe OpenSSL::SSL::Context do
context.verify_mode.should eq(OpenSSL::SSL::VerifyMode::PEER)
end

{% if LibSSL.has_method?(:ssl_ctx_set_alpn_protos) %}
if LibSSL.responds_to?(:ssl_ctx_set_alpn_protos)
it "alpn_protocol=" do
context = OpenSSL::SSL::Context::Client.insecure
context.alpn_protocol = "h2"
end
{% end %}
end

it "calls #finalize on insecure client context" do
assert_finalizes("insecure_client_ctx") { OpenSSL::SSL::Context::Client.insecure }
Expand Down
4 changes: 2 additions & 2 deletions src/openssl/lib_ssl.cr
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ lib LibSSL
{% end %}
end

{% if LibSSL.has_method?(:ssl_library_init) %}
if LibSSL.responds_to?(:ssl_library_init)
LibSSL.ssl_library_init
LibSSL.ssl_load_error_strings
LibCrypto.openssl_add_all_algorithms
LibCrypto.err_load_crypto_strings
{% end %}
end

0 comments on commit 0ede31e

Please sign in to comment.