JuliaWeb / HTTP.jl

HTTP for Julia
https://juliaweb.github.io/HTTP.jl/stable/
Other
635 stars 176 forks source link

OpenSSL.OpenSSLError("hostname mismatch") in HTTP v1.10 #1136

Open alihaddad-dynideas opened 9 months ago

alihaddad-dynideas commented 9 months ago

Hello, when I try to run this code I get the following error:

`res = HTTP.request(requestType,url , ["Content-Type" => "application/json", "Accept"=>"application/json", "AstroIdentity" => autKey ], body)'

It is working with older version of HTTP like v1.8.1.

This is the error message:

caused by: OpenSSL.OpenSSLError("hostname mismatch")
Stacktrace:
  [1] macro expansion
    @ ~/.julia/packages/OpenSSL/8wxMC/src/ssl.jl:512 [inlined]
  [2] macro expansion
    @ ./lock.jl:267 [inlined]
  [3] connect(ssl::OpenSSL.SSLStream; require_ssl_verification::Bool)
    @ OpenSSL ~/.julia/packages/OpenSSL/8wxMC/src/ssl.jl:505
  [4] connect
    @ ~/.julia/packages/OpenSSL/8wxMC/src/ssl.jl:489 [inlined]
  [5] #sslconnection#19
    @ ~/.julia/packages/HTTP/bDoga/src/Connections.jl:594 [inlined]
  [6] sslconnection
    @ ~/.julia/packages/HTTP/bDoga/src/Connections.jl:584 [inlined]
  [7] getconnection(::Type{OpenSSL.SSLStream}, host::SubString{String}, port::SubString{String}; kw::Base.Pairs{Symbol, Union{Nothing, Integer}, NTuple{6, Symbol}, NamedTuple{(:require_ssl_verification, :keepalive, :readtimeout, :iofunction, :decompress, :verbose), Tuple{Bool, Bool, Int64, Nothing, Nothing, Int64}}})
    @ HTTP.Connections ~/.julia/packages/HTTP/bDoga/src/Connections.jl:581
  [8] getconnection
    @ ~/.julia/packages/HTTP/bDoga/src/Connections.jl:573 [inlined]
  [9] #10
    @ ~/.julia/packages/HTTP/bDoga/src/Connections.jl:462 [inlined]
 [10] macro expansion
    @ ~/.julia/packages/ConcurrentUtilities/dDnHe/src/try_with_timeout.jl:82 [inlined]
 [11] (::ConcurrentUtilities.var"#2#4"{Any, Timer, ConcurrentUtilities.TimedOut{Any}, Channel{Any}, HTTP.Connections.var"#10#13"{OpenSSL.SSLStream, Bool, Bool, Base.Pairs{Symbol, Union{Nothing, Int64}, NTuple{4, Symbol}, NamedTuple{(:readtimeout, :iofunction, :decompress, :verbose), Tuple{Int64, Nothing, Nothing, Int64}}}, SubString{String}, SubString{String}}})()
    @ ConcurrentUtilities ./threadingconstructs.jl:416
Stacktrace:
  [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
    @ Base ./task.jl:920
  [2] wait()
    @ Base ./task.jl:984
  [3] wait(c::Base.GenericCondition{ReentrantLock}; first::Bool)
    @ Base ./condition.jl:130
  [4] wait
    @ ./condition.jl:125 [inlined]
  [5] take_unbuffered(c::Channel{Any})
    @ Base ./channels.jl:488
  [6] take!
    @ ./channels.jl:465 [inlined]
  [7] try_with_timeout(f::Function, timeout::Int64, ::Type{Any})
    @ ConcurrentUtilities ~/.julia/packages/ConcurrentUtilities/dDnHe/src/try_with_timeout.jl:89
  [8] try_with_timeout
    @ ~/.julia/packages/ConcurrentUtilities/dDnHe/src/try_with_timeout.jl:77 [inlined]
  [9] (::HTTP.Connections.var"#9#12"{OpenSSL.SSLStream, Int64, Int64, Bool, Bool, Base.Pairs{Symbol, Union{Nothing, Int64}, NTuple{4, Symbol}, NamedTuple{(:readtimeout, :iofunction, :decompress, :verbose), Tuple{Int64, Nothing, Nothing, Int64}}}, SubString{String}, SubString{String}})()