Skip to content

--aws-sigv4 doesn't sign requests with query string parameters with no value correctly #8107

@dzaslavskiy

Description

@dzaslavskiy

This request gives an error:

curl --user "<key>:<secret>" --aws-sigv4 aws:amz:<region>:es -k -X GET 'https://<es-host>/_cat/indices?v'

{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}

Removing the query string or or adding a value to the query parameter fixes the issue

curl --user "<key>:<secret>" --aws-sigv4 aws:amz:<region>:es -k -X GET 'https://<es-host>/_cat/indices'

green open index-name index-uuid 5 1       16    0 285.4kb 142.7kb
curl --user "<key>:<secret>" --aws-sigv4 aws:amz:<region>:es -k -X GET 'https://<es-host>/_cat/indices?v=true'

green open index-name index-uuid 5 1       16    0 285.4kb 142.7kb

curl/libcurl version

curl 7.79.1 (x86_64-w64-mingw32) libcurl/7.79.1 OpenSSL/1.1.1l (Schannel) zlib/1.2.11 brotli/1.0.9 zstd/1.5.0 libidn2/2.3.1 libssh2/1.10.0 nghttp2/1.45.1
Release-Date: 2021-09-22
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP zstd

operating system

windows 10; git-bash

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions