Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set TLS option CURLSSLOPT_REVOKE_BEST_EFFORT #115

Merged
merged 1 commit into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Curl/Curl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/Curl/Easy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
5 changes: 1 addition & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down