-
Notifications
You must be signed in to change notification settings - Fork 178
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
No method matching sslupgrade #1172
Comments
Can you please provide a small, self-contained script that emits this error, @shikil ? |
yes, the most recent update introduced this bug: And it break the function |
Thanks for the information, but that's not a runnable example for me. The code you linked is intended to replace the default value (nothing) with the old default type (SOCKET_TYPE_TLS[]) if the caller has not specified an sslconfig. I appreciate that my implementation is probably buggy, given this error report, but I don't see a mistake in the code. |
I'm hitting this same error after |
|
On a fresh Julia v1.10.2 install. I'm running behind a proxy.
|
Downgrading HTTP to v1.10.5, it works.
|
I created a branch with new tests for this and I have not been able to reproduce the issue on Julia 1.9.2 or 1.10.2. See this branch for the commit that adds the tests. Maybe you can try pulling in that branch as your HTTP.jl and running the tests? https://github.com/cmcaine/HTTP.jl/tree/fix-1172 And here's some manual testing using the current #master version of HTTP.jl: julia> using HTTP
julia> HTTP.get("https://data.etabus.gov.hk/")
HTTP.Messages.Response:
"""
HTTP/1.1 200 OK
Date: CENSORED
Content-Length: 0
Connection: keep-alive
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
x-azure-ref: CENSORED
X-Cache: CONFIG_NOCACHE
Accept-Ranges: bytes
"""
julia> versioninfo()
Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 12 × 12th Gen Intel(R) Core(TM) i5-12400F
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, alderlake)
Threads: 1 on 12 virtual cores
(HTTP) pkg> status
Project HTTP v1.10.6
Status `~/.julia/dev/HTTP/Project.toml`
[944b1d66] CodecZlib v0.7.4
[f0e56b4a] ConcurrentUtilities v2.4.1
[460bff9d] ExceptionUnwrapping v0.1.10
[e6f89c97] LoggingExtras v1.0.3
[739be429] MbedTLS v1.1.9
[4d8831e6] OpenSSL v1.4.3
[777ac1f9] SimpleBufferStream v1.1.0
[5c2747f8] URIs v1.5.1
[2a0f44e3] Base64
[ade2ca70] Dates
[56ddb016] Logging
[ca575930] NetworkOptions v1.2.0
[9a3f8284] Random
[6462fe0b] Sockets
[cf7118a7] UUIDs |
Same error in Julia 1.10.3, I also tested behind proxy, so it may be cause |
Using branch https://github.com/cmcaine/HTTP.jl/tree/fix-1172 I got the following error.
cc @cmcaine |
Please run versioninfo() and Pkg.status() paste the outputs.
…On Mon, 6 May 2024, 20:40 Felipe Noronha, ***@***.***> wrote:
Using branch https://github.com/cmcaine/HTTP.jl/tree/fix-1172 I got the
following error.
julia> HTTP.get("https://data.etabus.gov.hk/")
ERROR: HTTP.RequestError:
HTTP.Request:
HTTP.Messages.Request:
"""
GET / HTTP/1.1
Host: data.etabus.gov.hk
Accept: */*
User-Agent: HTTP.jl/1.10.2
Content-Length: 0
Accept-Encoding: gzip
Proxy-Authorization: ******
"""Underlying error:
MethodError: no method matching sslupgrade(::Nothing, ::HTTP.Connections.Connection{Sockets.TCPSocket}, ::SubString{String}; readtimeout::Int64, iofunction::Nothing, decompress::Nothing, verbose::Int64)
Closest candidates are:
sslupgrade(::Type{IOType}, ::HTTP.Connections.Connection{T}, ::AbstractString; pool, require_ssl_verification, keepalive, readtimeout, kw...) where {T, IOType}
@ HTTP ~/work/tmp/HTTP.jl/src/Connections.jl:613
Stacktrace:
[1] (::HTTP.ConnectionRequest.var"#connections#4"{…})(req::HTTP.Messages.Request; proxy::String, socket_type::Type, socket_type_tls::Nothing, readtimeout::Int64, connect_timeout::Int64, logerrors::Bool, logtag::Nothing, ***@***.***{…})
@ HTTP.ConnectionRequest ~/work/tmp/HTTP.jl/src/clientlayers/ConnectionRequest.jl:140
[2] connections
@ ~/work/tmp/HTTP.jl/src/clientlayers/ConnectionRequest.jl:58 [inlined]
[3] (::Base.var"#96#98"{Base.var"#96#97#99"{…}})(args::HTTP.Messages.Request; ***@***.***{iofunction::Nothing, decompress::Nothing, verbose::Int64})
@ Base ./error.jl:296
[4] (::HTTP.RetryRequest.var"#manageretries#3"{…})(req::HTTP.Messages.Request; retry::Bool, retries::Int64, retry_delays::ExponentialBackOff, retry_check::Function, retry_non_idempotent::Bool, ***@***.***{…})
@ HTTP.RetryRequest ~/work/tmp/HTTP.jl/src/clientlayers/RetryRequest.jl:75
[5] manageretries
@ ~/work/tmp/HTTP.jl/src/clientlayers/RetryRequest.jl:30 [inlined]
[6] (::HTTP.CookieRequest.var"#managecookies#4"{…})(req::HTTP.Messages.Request; cookies::Bool, cookiejar::HTTP.Cookies.CookieJar, ***@***.***{…})
@ HTTP.CookieRequest ~/work/tmp/HTTP.jl/src/clientlayers/CookieRequest.jl:42
[7] managecookies
@ ~/work/tmp/HTTP.jl/src/clientlayers/CookieRequest.jl:19 [inlined]
[8] (::HTTP.HeadersRequest.var"#defaultheaders#2"{…})(req::HTTP.Messages.Request; iofunction::Nothing, decompress::Nothing, basicauth::Bool, detect_content_type::Bool, canonicalize_headers::Bool, ***@***.***{…})
@ HTTP.HeadersRequest ~/work/tmp/HTTP.jl/src/clientlayers/HeadersRequest.jl:71
[9] defaultheaders
@ ~/work/tmp/HTTP.jl/src/clientlayers/HeadersRequest.jl:14 [inlined]
[10] (::HTTP.RedirectRequest.var"#redirects#3"{…})(req::HTTP.Messages.Request; redirect::Bool, redirect_limit::Int64, redirect_method::Nothing, forwardheaders::Bool, response_stream::Nothing, ***@***.***{…})
@ HTTP.RedirectRequest ~/work/tmp/HTTP.jl/src/clientlayers/RedirectRequest.jl:25
[11] redirects
@ ~/work/tmp/HTTP.jl/src/clientlayers/RedirectRequest.jl:14 [inlined]
[12] (::HTTP.MessageRequest.var"#makerequest#3"{…})(method::String, url::URIs.URI, headers::Nothing, body::Vector{…}; copyheaders::Bool, response_stream::Nothing, http_version::HTTP.Strings.HTTPVersion, verbose::Int64, ***@***.***{})
@ HTTP.MessageRequest ~/work/tmp/HTTP.jl/src/clientlayers/MessageRequest.jl:35
[13] makerequest
@ ~/work/tmp/HTTP.jl/src/clientlayers/MessageRequest.jl:24 [inlined]
[14] request(stack::HTTP.MessageRequest.var"#makerequest#3"{…}, method::String, url::String, h::Nothing, b::Vector{…}, q::Nothing; headers::Nothing, body::Vector{…}, query::Nothing, ***@***.***{})
@ HTTP ~/work/tmp/HTTP.jl/src/HTTP.jl:457
[15] request(stack::Function, method::String, url::String, h::Nothing, b::Vector{UInt8}, q::Nothing)
@ HTTP ~/work/tmp/HTTP.jl/src/HTTP.jl:455
[16] #request#20
@ ~/work/tmp/HTTP.jl/src/HTTP.jl:315 [inlined]
[17] request (repeats 2 times)
@ ~/work/tmp/HTTP.jl/src/HTTP.jl:313 [inlined]
[18] get(a::String)
@ HTTP ~/work/tmp/HTTP.jl/src/HTTP.jl:518
[19] top-level scope
@ REPL[3]:1
caused by: MethodError: no method matching sslupgrade(::Nothing, ::HTTP.Connections.Connection{Sockets.TCPSocket}, ::SubString{String}; readtimeout::Int64, iofunction::Nothing, decompress::Nothing, verbose::Int64)
Closest candidates are:
sslupgrade(::Type{IOType}, ::HTTP.Connections.Connection{T}, ::AbstractString; pool, require_ssl_verification, keepalive, readtimeout, kw...) where {T, IOType}
@ HTTP ~/work/tmp/HTTP.jl/src/Connections.jl:613
Stacktrace:
[1] (::HTTP.ConnectionRequest.var"#connections#4"{…})(req::HTTP.Messages.Request; proxy::String, socket_type::Type, socket_type_tls::Nothing, readtimeout::Int64, connect_timeout::Int64, logerrors::Bool, logtag::Nothing, ***@***.***{…})
@ HTTP.ConnectionRequest ~/work/tmp/HTTP.jl/src/clientlayers/ConnectionRequest.jl:113
[2] connections
@ ~/work/tmp/HTTP.jl/src/clientlayers/ConnectionRequest.jl:58 [inlined]
[3] (::Base.var"#96#98"{Base.var"#96#97#99"{…}})(args::HTTP.Messages.Request; ***@***.***{iofunction::Nothing, decompress::Nothing, verbose::Int64})
@ Base ./error.jl:296
[4] (::HTTP.RetryRequest.var"#manageretries#3"{…})(req::HTTP.Messages.Request; retry::Bool, retries::Int64, retry_delays::ExponentialBackOff, retry_check::Function, retry_non_idempotent::Bool, ***@***.***{…})
@ HTTP.RetryRequest ~/work/tmp/HTTP.jl/src/clientlayers/RetryRequest.jl:75
[5] manageretries
@ ~/work/tmp/HTTP.jl/src/clientlayers/RetryRequest.jl:30 [inlined]
[6] (::HTTP.CookieRequest.var"#managecookies#4"{…})(req::HTTP.Messages.Request; cookies::Bool, cookiejar::HTTP.Cookies.CookieJar, ***@***.***{…})
@ HTTP.CookieRequest ~/work/tmp/HTTP.jl/src/clientlayers/CookieRequest.jl:42
[7] managecookies
@ ~/work/tmp/HTTP.jl/src/clientlayers/CookieRequest.jl:19 [inlined]
[8] (::HTTP.HeadersRequest.var"#defaultheaders#2"{…})(req::HTTP.Messages.Request; iofunction::Nothing, decompress::Nothing, basicauth::Bool, detect_content_type::Bool, canonicalize_headers::Bool, ***@***.***{…})
@ HTTP.HeadersRequest ~/work/tmp/HTTP.jl/src/clientlayers/HeadersRequest.jl:71
[9] defaultheaders
@ ~/work/tmp/HTTP.jl/src/clientlayers/HeadersRequest.jl:14 [inlined]
[10] (::HTTP.RedirectRequest.var"#redirects#3"{…})(req::HTTP.Messages.Request; redirect::Bool, redirect_limit::Int64, redirect_method::Nothing, forwardheaders::Bool, response_stream::Nothing, ***@***.***{…})
@ HTTP.RedirectRequest ~/work/tmp/HTTP.jl/src/clientlayers/RedirectRequest.jl:25
[11] redirects
@ ~/work/tmp/HTTP.jl/src/clientlayers/RedirectRequest.jl:14 [inlined]
[12] (::HTTP.MessageRequest.var"#makerequest#3"{…})(method::String, url::URIs.URI, headers::Nothing, body::Vector{…}; copyheaders::Bool, response_stream::Nothing, http_version::HTTP.Strings.HTTPVersion, verbose::Int64, ***@***.***{})
@ HTTP.MessageRequest ~/work/tmp/HTTP.jl/src/clientlayers/MessageRequest.jl:35
[13] makerequest
@ ~/work/tmp/HTTP.jl/src/clientlayers/MessageRequest.jl:24 [inlined]
[14] request(stack::HTTP.MessageRequest.var"#makerequest#3"{…}, method::String, url::String, h::Nothing, b::Vector{…}, q::Nothing; headers::Nothing, body::Vector{…}, query::Nothing, ***@***.***{})
@ HTTP ~/work/tmp/HTTP.jl/src/HTTP.jl:457
[15] request(stack::Function, method::String, url::String, h::Nothing, b::Vector{UInt8}, q::Nothing)
@ HTTP ~/work/tmp/HTTP.jl/src/HTTP.jl:455
[16] #request#20
@ ~/work/tmp/HTTP.jl/src/HTTP.jl:315 [inlined]
[17] request (repeats 2 times)
@ ~/work/tmp/HTTP.jl/src/HTTP.jl:313 [inlined]
[18] get(a::String)
@ HTTP ~/work/tmp/HTTP.jl/src/HTTP.jl:518
[19] top-level scope
@ REPL[3]:1
Some type information was truncated. Use `show(err)` to see complete types.
cc @cmcaine <https://github.com/cmcaine>
—
Reply to this email directly, view it on GitHub
<#1172 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNZA6LPLVZYIUJ5QWAECP3ZA7MBDAVCNFSM6AAAAABGUBUOXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJWG43TGMRYGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I also ran the test suite. cc @cmcaine
|
I can't reproduce the error and I don't see an error in my code. I've tried running the code on two x86_64 machines on different networks and with three different Julia versions. The error might be occurring because of some peculiarity of your network environment (are you on a corporate network?) or because of something to do with the libraries in your LD_LIBRARY_PATH. Can you try tunning again with LD_LIBRARY_PATH unset and from a different network? Here's the script that I am testing with: # save as repro.jl
# run with: julia repro.jl
using Pkg
Pkg.activate(;temp=true)
Pkg.add(url="https://github.com/cmcaine/HTTP.jl", rev="fix-1172")
Pkg.test("HTTP", test_args=["issue-1172.jl"])
using InteractiveUtils: versioninfo
versioninfo() |
Okay, I couldn't reproduce the issue because it only occurs if you have a proxy. This is now fixed in PR #1174. |
I'm sorry for my oversight in not seeing this when I changed the code in the first place and for how long it took me to see the error once this issue was opened. |
@cmcaine thanks a lot! I tested again using "https://github.com/cmcaine/HTTP.jl", rev="fix-1172", and it now works!
|
It work now, thanks a lot. |
Please specify the following versions when submitting a bug report:
After upgrading HTTP.jl from 1.10.5 to 1.10.6, I get the following error message.
The text was updated successfully, but these errors were encountered: