diff --git a/src/Curl/Curl.jl b/src/Curl/Curl.jl index 3d86b61..e4f5171 100644 --- a/src/Curl/Curl.jl +++ b/src/Curl/Curl.jl @@ -29,6 +29,10 @@ using LibCURL using LibCURL: curl_off_t # not exported: https://github.com/JuliaWeb/LibCURL.jl/issues/87 +# constants that LibCURL should have but doesn't +const CURLE_PEER_FAILED_VERIFICATION = 60 +const CURLSSLOPT_REVOKE_BEST_EFFORT = 1 << 3 + using NetworkOptions using Base: preserve_handle, unpreserve_handle diff --git a/src/Curl/Easy.jl b/src/Curl/Easy.jl index a99daaf..97cc254 100644 --- a/src/Curl/Easy.jl +++ b/src/Curl/Easy.jl @@ -49,6 +49,8 @@ function set_defaults(easy::Easy) setopt(easy, CURLOPT_MAXREDIRS, 50) setopt(easy, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL) setopt(easy, CURLOPT_USERAGENT, USER_AGENT) + setopt(easy, CURLOPT_SSL_OPTIONS, CURLSSLOPT_REVOKE_BEST_EFFORT) + # ssh-related options setopt(easy, CURLOPT_SSH_PRIVATE_KEYFILE, ssh_key_path()) setopt(easy, CURLOPT_SSH_PUBLIC_KEYFILE, ssh_pub_key_path()) diff --git a/test/runtests.jl b/test/runtests.jl index 0ee78c1..70bfc53 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -371,10 +371,7 @@ include("setup.jl") @testset "bad TLS is rejected" for url in urls resp = request(url, throw=false) @test resp isa RequestError - # FIXME: we should use Curl.CURLE_PEER_FAILED_VERIFICATION - # but LibCURL has gotten out of sync with curl and some - # of the constants are no longer correct; this is one - @test resp.code == 60 + @test resp.code == Curl.CURLE_PEER_FAILED_VERIFICATION end @testset "easy hook work-around" begin local url