python - How to view Boto3 HTTPS request string -
i have been able view attributes of preparedrequest botocore sends, i'm wondering how can view exact request string sent aws. need exact request string able compare application i'm testing aws calls with.
so want send request through proxy (mitmproxy, squid). check proxy sent. since https data encrypted must first decrypt it, log response, encrypt , send aws. 1 of options use mitmproxy. ( it's easy install )
- run mitmproxy
open terminal , point proxy mitmproxys port:
export http_proxy=127.0.0.1:8080 export https_proxy=$http_proxythen set
verify=falsewhen creating session/clientin [1]: import botocore.session in [2]: client = botocore.session.session().create_client('elasticache', verify=false)send request , @ output of mitmproxy
in [3]: client.describe_cache_engine_versions()the result should similar this:
host: elasticache.us-east-1.amazonaws.com accept-encoding: identity content-length: 53 content-type: application/x-www-form-urlencoded authorization: aws4-hmac-sha256 credential=foooooo/20150428/us-east-1/elasticache/aws4_request, signedheaders=host;user-agent;x-amz-date, signature=baaaaaar x-amz-date: 20150428t213004z user-agent: botocore/0.103.0 python/2.7.6 linux/3.13.0-49-generic
<?xml version='1.0' encoding='utf-8'?> <describecacheengineversionsresponse xmlns="http://elasticache.amazonaws.com/doc/2015-02-02/"> <describecacheengineversionsresult> <cacheengineversions> <cacheengineversion> <cacheparametergroupfamily>memcached1.4</cacheparametergroupfamily> <engine>memcached</engine> <cacheengineversiondescription>memcached version 1.4.14</cacheengineversiondescription> <cacheenginedescription>memcached</cacheenginedescription> <engineversion>1.4.14</engineversion>
Comments
Post a Comment