Use `mitmproxy` with Julia AWS.jl

I was trying to use mitmproxy to debug a AWS connection issue, however it produces the following error, any idea why?

ERROR: DNSError: , unknown node or service (EAI_NONAME)
Stacktrace:
 [1] getalladdrinfo(::String) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Sockets/src/addrinfo.jl:112
 [2] getalladdrinfo at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Sockets/src/addrinfo.jl:121 [inlined]
 [3] getconnection(::Type{Sockets.TCPSocket}, ::SubString{String}, ::SubString{String}; keepalive::Bool, connect_timeout::Int64, kw::Base.Iterators.Pairs{Symbol,Union{Nothing, Bool},Tuple{Symbol,Symbol,Symbol},NamedTuple{(:require_ssl_verification, :iofunction, :reached_redirect_limit),Tuple{Bool,Nothing,Bool}}}) at /Users/roger/.julia/packages/HTTP/IAI92/src/ConnectionPool.jl:630
 [4] #newconnection#25 at /Users/roger/.julia/packages/HTTP/IAI92/src/ConnectionPool.jl:597 [inlined]
 [5] getconnection(::Type{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}, ::SubString{String}, ::SubString{String}; connection_limit::Int64, pipeline_limit::Int64, idle_timeout::Int64, reuse_limit::Int64, require_ssl_verification::Bool, kw::Base.Iterators.Pairs{Symbol,Union{Nothing, Bool},Tuple{Symbol,Symbol},NamedTuple{(:iofunction, :reached_redirect_limit),Tuple{Nothing,Bool}}}) at /Users/roger/.julia/packages/HTTP/IAI92/src/ConnectionPool.jl:541

you should be able to reproduce this by following steps (similar to boto3 version: https://stackoverflow.com/questions/29929540/how-to-view-boto3-https-request-string ):

  1. install mitmproxy and run it
  2. export proxies
export http_proxy=127.0.0.1:8080
export https_proxy=$http_proxy

then run (this request itself will have a 403 error, but if the proxy is set then Julia will just fail)

using AWS: @service
@service Braket
Braket.get_device("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
1 Like