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

MethodError on findfirst instead of "Certificate verification failed" #274

Closed
nsslh opened this issue Nov 14, 2023 · 2 comments · Fixed by #276
Closed

MethodError on findfirst instead of "Certificate verification failed" #274

nsslh opened this issue Nov 14, 2023 · 2 comments · Fixed by #276

Comments

@nsslh
Copy link
Contributor

nsslh commented Nov 14, 2023

There's a regression in 1.1.8. Previously, peer certificate validation errors would produce an exception with message "Certificate verification failed".

Since 8c73ac4, the exception is:

  MethodError: no method matching findfirst(::UInt8, ::Vector{UInt8})
  
  Closest candidates are:
    findfirst(::AbstractVector{<:Union{Int8, UInt8}}, ::AbstractVector{<:Union{Int8, UInt8}})
     @ Base strings/search.jl:158
    findfirst(::Base.Fix2{<:Union{typeof(==), typeof(isequal)}, <:Union{Int8, UInt8}}, ::Union{Base.CodeUnits{UInt8, String}, Vector{Int8}, Vector{UInt8}, SubArray{Int8, 1, Vector{Int8}, I, true} where I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}, SubArray{UInt8, 1, Base.CodeUnits{UInt8, String}, I, true} where I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}, SubArray{UInt8, 1, Vector{UInt8}, I, true} where I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}})
     @ Base strings/search.jl:32
    findfirst(::typeof(iszero), ::Union{Base.CodeUnits{UInt8, String}, Vector{Int8}, Vector{UInt8}, SubArray{Int8, 1, Vector{Int8}, I, true} where I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}, SubArray{UInt8, 1, Base.CodeUnits{UInt8, String}, I, true} where I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}, SubArray{UInt8, 1, Vector{UInt8}, I, true} where I<:Union{Tuple{Vararg{Real}}, Tuple{AbstractUnitRange, Vararg{Any}}}})
     @ Base strings/search.jl:38
    ...
  
  Stacktrace:
    [1] strerror(ret::Int32, bufsize::Int64)
      @ MbedTLS ~/.julia/packages/MbedTLS/GKTMC/src/error.jl:25
    [2] strerror(ret::Int32)
      @ MbedTLS ~/.julia/packages/MbedTLS/GKTMC/src/error.jl:21
    [3] mbed_ioerr(ret::Int32)
      @ MbedTLS ~/.julia/packages/MbedTLS/GKTMC/src/error.jl:18
    [4] handshake(ctx::MbedTLS.SSLContext)
      @ MbedTLS ~/.julia/packages/MbedTLS/GKTMC/src/ssl.jl:81
    [5] setup_tls(sock::Sockets.TCPSocket, hostname::String, ssl_options::SSLConfig)
      @ AMQPClient ~/.julia/packages/AMQPClient/1GBMt/src/amqps.jl:70
    [6] connection(; virtualhost::String, host::String, port::Int64, framemax::Int64, heartbeat::Bool, keepalive::Int64, send_queue_size::Int64, auth_params::Dict{String, Any}, channelmax::Int64, connect_timeout::Int64, amqps::SSLConfig)
      @ AMQPClient ~/.julia/packages/AMQPClient/1GBMt/src/protocol.jl:662
    [7] run_rpc_server(; host::String, login::String, password::String, queue_name::String, routes::Dict{String, Function}, env::Dict{String, String}, fire_forget::Bool)
      @ RabbitRpcServer /app/src/RabbitRpcServer.jl:169
...

This is on julia-1.9.3, from the julia:1.9.3-alpine3.18 Docker image:

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-alpine-linux-musl)
  CPU: 16 × Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 16 virtual cores
Environment:
  JULIA_GPG = 3673DF529D9049477F76B37566E3C7DC03D6E495
  JULIA_VERSION = 1.9.3
  JULIA_PATH = /usr/local/julia
@nsslh
Copy link
Contributor Author

nsslh commented Nov 15, 2023

@vtjnash

Since 8c73ac4, the exception is:

  MethodError: no method matching findfirst(::UInt8, ::Vector{UInt8})

nsslh added a commit to nsslh/MbedTLS.jl that referenced this issue Nov 17, 2023
nsslh added a commit to nsslh/MbedTLS.jl that referenced this issue Nov 17, 2023
@nsslh
Copy link
Contributor Author

nsslh commented Nov 17, 2023

If you're not happy with my butchery of the test suite, you can just cherry-pick nsslh/MbedTLS.jl@1a0fe48.

nsslh added a commit to nsslh/MbedTLS.jl that referenced this issue Nov 17, 2023
nsslh added a commit to nsslh/MbedTLS.jl that referenced this issue Nov 17, 2023
@Keno Keno closed this as completed in #276 Nov 22, 2023
Keno pushed a commit that referenced this issue Nov 22, 2023
* Demonstrate strerror regression

Re #274

* Fix regression in strerror

Fixes #274

* Match exception substring

* Fix test on julia-1.6
Keno added a commit that referenced this issue Nov 22, 2023
To pick up the fix for #274
Keno added a commit that referenced this issue Nov 22, 2023
To pick up the fix for #274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant