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 c143fdd..88a867c 100644 --- a/src/Curl/Easy.jl +++ b/src/Curl/Easy.jl @@ -51,6 +51,7 @@ function set_defaults(easy::Easy) setopt(easy, CURLOPT_USERAGENT, USER_AGENT) setopt(easy, CURLOPT_NETRC, CURL_NETRC_OPTIONAL) setopt(easy, CURLOPT_COOKIEFILE, "") + setopt(easy, CURLOPT_SSL_OPTIONS, CURLSSLOPT_REVOKE_BEST_EFFORT) # ssh-related options setopt(easy, CURLOPT_SSH_PRIVATE_KEYFILE, ssh_key_path()) diff --git a/test/runtests.jl b/test/runtests.jl index e52892b..fd4bb20 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -414,10 +414,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