As from the title.
using HTTP
dataURL = "https://bit.ly/apress_julia_boston"
data = @pipe HTTP.get(dataURL).body
results in:
ERROR: http tls handshake error: tls handshake failed: tls: certificate is not valid for host bit.ly [tls: certificate is not valid for host bit.ly]
Stacktrace:
[1] request(method::String, url::String, h::Vector{…}, b::Nothing; headers::Vector{…}, body::Nothing, basicauth::Nothing, retry::Bool, retries::Int64, retry_non_idempotent::Bool, retry_if::Nothing, respect_retry_after::Bool, retry_bucket::Bool, status_exception::Bool, redirect::Bool, redirect_limit::Nothing, redirect_method::Nothing, forwardheaders::Bool, proxy::HTTP._UseTransportProxy, cookies::Bool, cookiejar::Nothing, query::Nothing, response_stream::Nothing, decompress::Nothing, max_decompressed_size::Int64, sse_callback::Nothing, client::Nothing, context::Nothing, connect_timeout::Int64, request_timeout::Int64, response_header_timeout::Int64, read_idle_timeout::Int64, write_idle_timeout::Int64, expect_continue_timeout::Nothing, readtimeout::Nothing, copyheaders::Nothing, pool::Nothing, canonicalize_headers::Nothing, detect_content_type::Nothing, observelayers::Nothing, retry_delays::Nothing, retry_check::Nothing, sslconfig::Nothing, socket_type_tls::Nothing, logerrors::Nothing, logtag::Nothing, trace::Nothing, verbose::Nothing, require_ssl_verification::Bool, protocol::Symbol)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:1950
[2] request
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:1781 [inlined]
[3] #get#106
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2195 [inlined]
[4] get
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2194 [inlined]
[5] get(url::String)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2194
[6] top-level scope
@ Untitled-1:5
caused by: tls handshake failed: tls: certificate is not valid for host bit.ly [tls: certificate is not valid for host bit.ly]
Stacktrace:
[1] handshake!(conn::Reseau.TLS.Conn)
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/5_tls.jl:1629
[2]
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http2_client.jl:950
[3] #connect_h2!#36
@ ~/.julia/packages/HTTP/tDXzI/src/http2_client.jl:1050 [inlined]
[4] connect_h2!
@ ~/.julia/packages/HTTP/tDXzI/src/http2_client.jl:1041 [inlined]
[5] _acquire_h2_conn!(client::HTTP.Client{…}, plan::HTTP._ProxyPlan, address::String, secure::Bool, request::HTTP.Request{…}, server_name::String, allow_h1_alpn::Bool)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:481
[6] _do_incoming!(trace::Nothing, client::HTTP.Client{…}, address::String, request::HTTP.Request{…}, secure::Bool, server_name::String, protocol::Symbol, redirect_policy::HTTP._RedirectPolicy{…}, retry_controller::HTTP._RetryController{…}, proxy_config::HTTP.ProxyConfig, cookies::Bool, cookiejar::CookieJar)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:762
[7] request(method::String, url::String, h::Vector{…}, b::Nothing; headers::Vector{…}, body::Nothing, basicauth::Nothing, retry::Bool, retries::Int64, retry_non_idempotent::Bool, retry_if::Nothing, respect_retry_after::Bool, retry_bucket::Bool, status_exception::Bool, redirect::Bool, redirect_limit::Nothing, redirect_method::Nothing, forwardheaders::Bool, proxy::HTTP._UseTransportProxy, cookies::Bool, cookiejar::Nothing, query::Nothing, response_stream::Nothing, decompress::Nothing, max_decompressed_size::Int64, sse_callback::Nothing, client::Nothing, context::Nothing, connect_timeout::Int64, request_timeout::Int64, response_header_timeout::Int64, read_idle_timeout::Int64, write_idle_timeout::Int64, expect_continue_timeout::Nothing, readtimeout::Nothing, copyheaders::Nothing, pool::Nothing, canonicalize_headers::Nothing, detect_content_type::Nothing, observelayers::Nothing, retry_delays::Nothing, retry_check::Nothing, sslconfig::Nothing, socket_type_tls::Nothing, logerrors::Nothing, logtag::Nothing, trace::Nothing, verbose::Nothing, require_ssl_verification::Bool, protocol::Symbol)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:1908
[8] request
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:1781 [inlined]
[9] #get#106
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2195 [inlined]
[10] get
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2194 [inlined]
[11] get(url::String)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2194
[12] top-level scope
@ Untitled-1:5
caused by: tls: certificate is not valid for host bit.ly
Stacktrace:
[1] _tls_fail
@ ~/.julia/packages/Reseau/o1uhI/src/tls/record_common.jl:42 [inlined]
[2] _tls_verify_certificate_peer_name!(cert::Reseau.TLS._TLSCertificateInfo, peer_name::String)
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/tls/x509.jl:1296
[3] _tls_verify_certificate_chain(certificates::Vector{…}; verify_peer::Bool, verify_hostname::Bool, ca_file::String, purpose::String, peer_name::String)
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/tls/x509_verify.jl:613
[4] _tls_verify_certificate_chain
@ ~/.julia/packages/Reseau/o1uhI/src/tls/x509_verify.jl:585 [inlined]
[5] #_tls13_verify_certificate_chain#116
@ ~/.julia/packages/Reseau/o1uhI/src/tls/x509_verify.jl:695 [inlined]
[6] _tls13_verify_certificate_chain
@ ~/.julia/packages/Reseau/o1uhI/src/tls/x509_verify.jl:687 [inlined]
[7] #_tls13_verify_server_certificate_chain#117
@ ~/.julia/packages/Reseau/o1uhI/src/tls/x509_verify.jl:712 [inlined]
[8] _tls13_verify_server_certificate_chain
@ ~/.julia/packages/Reseau/o1uhI/src/tls/x509_verify.jl:705 [inlined]
[9] _tls13_verify_server_certificates!
@ ~/.julia/packages/Reseau/o1uhI/src/tls/handshake_client_tls13.jl:233 [inlined]
[10] _read_server_certificate!(state::Reseau.TLS._TLS13ClientHandshakeState, io::Reseau.TLS._TLS13HandshakeRecordIO)
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/tls/handshake_client_tls13.jl:753
[11]
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/tls/handshake_client_tls13.jl:868
[12] _native_tls_auto_client_handshake!(conn::Reseau.TLS.Conn)
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/5_tls.jl:1407
[13] (::Reseau.TLS.var"#handshake!##0#handshake!##1"{Reseau.TLS.Conn})()
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/5_tls.jl:1591
[14] _with_handshake_deadline(f::Reseau.TLS.var"#handshake!##0#handshake!##1"{Reseau.TLS.Conn}, conn::Reseau.TLS.Conn)
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/5_tls.jl:1503
[15] handshake!(conn::Reseau.TLS.Conn)
@ Reseau.TLS ~/.julia/packages/Reseau/o1uhI/src/5_tls.jl:1570
[16]
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http2_client.jl:950
[17] #connect_h2!#36
@ ~/.julia/packages/HTTP/tDXzI/src/http2_client.jl:1050 [inlined]
[18] connect_h2!
@ ~/.julia/packages/HTTP/tDXzI/src/http2_client.jl:1041 [inlined]
[19] _acquire_h2_conn!(client::HTTP.Client{…}, plan::HTTP._ProxyPlan, address::String, secure::Bool, request::HTTP.Request{…}, server_name::String, allow_h1_alpn::Bool)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:481
[20] _do_incoming!(trace::Nothing, client::HTTP.Client{…}, address::String, request::HTTP.Request{…}, secure::Bool, server_name::String, protocol::Symbol, redirect_policy::HTTP._RedirectPolicy{…}, retry_controller::HTTP._RetryController{…}, proxy_config::HTTP.ProxyConfig, cookies::Bool, cookiejar::CookieJar)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:762
[21] request(method::String, url::String, h::Vector{…}, b::Nothing; headers::Vector{…}, body::Nothing, basicauth::Nothing, retry::Bool, retries::Int64, retry_non_idempotent::Bool, retry_if::Nothing, respect_retry_after::Bool, retry_bucket::Bool, status_exception::Bool, redirect::Bool, redirect_limit::Nothing, redirect_method::Nothing, forwardheaders::Bool, proxy::HTTP._UseTransportProxy, cookies::Bool, cookiejar::Nothing, query::Nothing, response_stream::Nothing, decompress::Nothing, max_decompressed_size::Int64, sse_callback::Nothing, client::Nothing, context::Nothing, connect_timeout::Int64, request_timeout::Int64, response_header_timeout::Int64, read_idle_timeout::Int64, write_idle_timeout::Int64, expect_continue_timeout::Nothing, readtimeout::Nothing, copyheaders::Nothing, pool::Nothing, canonicalize_headers::Nothing, detect_content_type::Nothing, observelayers::Nothing, retry_delays::Nothing, retry_check::Nothing, sslconfig::Nothing, socket_type_tls::Nothing, logerrors::Nothing, logtag::Nothing, trace::Nothing, verbose::Nothing, require_ssl_verification::Bool, protocol::Symbol)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:1908
[22] request
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:1781 [inlined]
[23] #get#106
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2195 [inlined]
[24] get
@ ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2194 [inlined]
[25] get(url::String)
@ HTTP ~/.julia/packages/HTTP/tDXzI/src/http_client.jl:2194
[26] top-level scope
@ Untitled-1:5
Some type information was truncated. Use `show(err)` to see complete types.
Julia v1.12, HTTP v2.2.0
It was working fine before. I have tried other bit.ly URLs, and the issue seems generic, not specific to this redirect.