PUT Filename with colon(':') from AWS C++ SDK results in SignatureDoesNotMatch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I'm testing Swift access using S3 client (AWS SDK for C++).
I have tested file upload/download successfully with filename consisting alphanum chars.
This particular test fails when filename has ':'.
The same code works with AWS S3 and minio.
The code is trying to create an object with name
backup_
If I replace ':' with chars like '-'/'_' it works.
The error is:
SignatureDoesNo
The request signature we calculated does not match the signature you provided. Check your key and signing method.
I narrowed down this problem to this method in AWS SDK
StringUtils.cpp
Aws::String StringUtils:
-- snip --
if (IsAlnum(c) || c == '-' || c == '_' || c == '.' || c == '~')
{
escaped << (char)c;
}
else
{
//this unsigned char cast allows us to handle unicode characters.
escaped << '%' << std::setw(2) << int((unsigned char)c) << std::setw(0);
}
I suspect the Swift server end does not expect ':' escaped.
As a hack I changed the condition in SDK to
if (IsAlnum(c) || c == '-' || c == '_' || c == '.' || c == '~' || c == ':')
With this, I don't see any error.
Is this a known issue? Is there a workaround?
I found a very old discussion but did not understand how it was addressed.
https:/
Do I need to set any env variable on server end?
summary: |
- PUT Filename with ':' from AWS C++ SDK results in SignatureDoesNotMatch + PUT Filename with colon/':' from AWS C++ SDK results in + SignatureDoesNotMatch |
summary: |
- PUT Filename with colon/':' from AWS C++ SDK results in + PUT Filename with colon(':') from AWS C++ SDK results in SignatureDoesNotMatch |
description: | updated |
Hi,
I'd appreciate if someone can help me if there is a workaround.