Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Signature doesn't match error" if the folder or file name contains special character ":" #176

Open
arunkumarrspl opened this issue Nov 22, 2023 · 0 comments

Comments

@arunkumarrspl
Copy link

arunkumarrspl commented Nov 22, 2023

Names of folders and files in our s3 buckets have timestamps suffixes. For example, s3://dev-moderation.dev.viooh.net.cn/2023-10-25/14:12:16.980077/54df88c2-35a8-4e55-a464-29aa0e5

I am able to download the files using the proxy if they don't have :. But not able to download the files with the timestamps.

Example:-

Downloading the file with aws s3 cp command:-

root@ip-10-30-11-182:~# aws s3 cp s3://dev-moderation.dev.viooh.net.cn/test-file-31-10-2023/test-file-11:23/testfile testfile
download: s3://dev-moderation.dev.viooh.net.cn/test-file-31-10-2023/test-file-11:23/testfile to ./testfile

But when the HTTP request is made using the proxy :-

root@ip-10-30-11-182:~# curl -H 'host: s3.cn-northwest-1.amazonaws.com.cn' 'http://localhost:8080/dev-moderation.dev.viooh.net.cn/test-file-31-10-2023/test-file-11:23/testfile'
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><AWSAccessKeyId>ASIA4UMEKOSNWSYVO4CM</AWSAccessKeyId><StringToSign>AWS4-HMAC-SHA256
20231122T083730Z
20231122/cn-northwest-1/s3/aws4_request
a51eb9eb19a9a41b62d8a334a1861e4e31043661c0147bc042214d1469f0c0a1</StringToSign><SignatureProvided>03c59f7d44cfaa82023fe8bebba609fc0b52c40ceef80507c9b50c849283afc1</SignatureProvided><StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 32 33 31 31 32 32 54 30 38 33 37 33 30 5a 0a 32 30 32 33 31 31 32 32 2f 63 6e 2d 6e 6f 72 74 68 77 65 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 61 35 31 65 62 39 65 62 31 39 61 39 61 34 31 62 36 32 64 38 61 33 33 34 61 31 38 36 31 65 34 65 33 31 30 34 33 36 36 31 63 30 31 34 37 62 63 30 34 32 32 31 34 64 31 34 36 39 66 30 63 30 61 31</StringToSignBytes><CanonicalRequest>GET
/dev-moderation.dev.viooh.net.cn/test-file-31-10-2023/test-file-11%3A23/testfile

host:s3.cn-northwest-1.amazonaws.com.cn
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20231122T083730Z
x-amz-security-token:FwoDYXdzEAEaDHRQSAYiecr5h5NGsiLoBJk10x0FsINcgUgkDe3lklJ5H/rsvPo3z94ACzbDsH5rkQuCx18T/JUeMvJUVvoF/K6JA9XP2VhKPcTdVrOQTBVOEWk8AT9OiMtHDGbYqIyppTKdtaOVwXpLuq+E8A6XkHJbv9vNtN1aHW0ffF5H+RlYL/Qq92p7qnhUoIfAy0mAC0XWgRGay5zHs4SzfyLVMAvmimfcbVESy9P6pWUWCB6ib6B6eKP3j2VC0iLLU9AKkyTC+zc+IDNH3gt8fWDxpPTYSIbtdviQIh70ldAKLwP73l1yZ+R2q0BgHpXQ9mVSlOg+mo/h9ChBOVwDGQa6oDHSdxCQ30WDcchvDKufspvm6lpAc9HCqaGCiCKXYIx/0JLm3+mILmVI/R5Oh54FfAthZCHyrf78Pg8ENpwBOg9Vxqz3S7cfQL03MYdNDu2NL+muVh/rAAmr5H5GNdGySDqe3fgmeuKMx6yg9mR8nX2m2/1heZlYLMH5AEr/3Nxuu3cPEZ8iSz5Ae/nDwI8Ime6fFw799cBtvzTAaZ5C+Wecg69CaeMpcUrGHeZ4e6DMNB+S5a52j/B10O6TZwTgCn35lupIVObSLj8OqKYRNxq19grNVIYDxA7xHCaF2OazmKvCDqhje3rUPo/ufURtET1Yhok9ml5cLYEyAN/siOqibk9JYwAsWlHhAfcVoMYjzOn48P9j+GfjKFUHTFQnmqoFUYpfX+1JOjPvFw997+wNuRnHyQOosc2dZ16wkD1fYQsRIGdfKQcPvyLKVwAGVJrEH6DbLJFnR2bbcp7DBlzDToRN6y8jI/CDpbhH3Lg4Q76Lh4q1ROIoqfb2qgYyQUi6MW9KimqF5IetSUgn4h/fE1FznlkGwtlXj+jpzrYtzxeWH8ie/YxQLErp5rhueapSC+CY/gwf417h37Lg4Ddj

host;x-amz-content-sha256;x-amz-date;x-amz-security-token
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</CanonicalRequest><CanonicalRequestBytes>47 45 54 0a 2f 64 65 76 2d 6d 6f 64 65 72 61 74 69 6f 6e 2e 64 65 76 2e 76 69 6f 6f 68 2e 6e 65 74 2e 63 6e 2f 74 65 73 74 2d 66 69 6c 65 2d 33 31 2d 31 30 2d 32 30 32 33 2f 74 65 73 74 2d 66 69 6c 65 2d 31 31 25 33 41 32 33 2f 74 65 73 74 66 69 6c 65 0a 0a 68 6f 73 74 3a 73 33 2e 63 6e 2d 6e 6f 72 74 68 77 65 73 74 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 2e 63 6e 0a 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35 0a 78 2d 61 6d 7a 2d 64 61 74 65 3a 32 30 32 33 31 31 32 32 54 30 38 33 37 33 30 5a 0a 78 2d 61 6d 7a 2d 73 65 63 75 72 69 74 79 2d 74 6f 6b 65 6e 3a 46 77 6f 44 59 58 64 7a 45 41 45 61 44 48 52 51 53 41 59 69 65 63 72 35 68 35 4e 47 73 69 4c 6f 42 4a 6b 31 30 78 30 46 73 49 4e 63 67 55 67 6b 44 65 33 6c 6b 6c 4a 35 48 2f 72 73 76 50 6f 33 7a 39 34 41 43 7a 62 44 73 48 35 72 6b 51 75 43 78 31 38 54 2f 4a 55 65 4d 76 4a 55 56 76 6f 46 2f 4b 36 4a 41 39 58 50 32 56 68 4b 50 63 54 64 56 72 4f 51 54 42 56 4f 45 57 6b 38 41 54 39 4f 69 4d 74 48 44 47 62 59 71 49 79 70 70 54 4b 64 74 61 4f 56 77 58 70 4c 75 71 2b 45 38 41 36 58 6b 48 4a 62 76 39 76 4e 74 4e 31 61 48 57 30 66 66 46 35 48 2b 52 6c 59 4c 2f 51 71 39 32 70 37 71 6e 68 55 6f 49 66 41 79 30 6d 41 43 30 58 57 67 52 47 61 79 35 7a 48 73 34 53 7a 66 79 4c 56 4d 41 76 6d 69 6d 66 63 62 56 45 53 79 39 50 36 70 57 55 57 43 42 36 69 62 36 42 36 65 4b 50 33 6a 32 56 43 30 69 4c 4c 55 39 41 4b 6b 79 54 43 2b 7a 63 2b 49 44 4e 48 33 67 74 38 66 57 44 78 70 50 54 59 53 49 62 74 64 76 69 51 49 68 37 30 6c 64 41 4b 4c 77 50 37 33 6c 31 79 5a 2b 52 32 71 30 42 67 48 70 58 51 39 6d 56 53 6c 4f 67 2b 6d 6f 2f 68 39 43 68 42 4f 56 77 44 47 51 61 36 6f 44 48 53 64 78 43 51 33 30 57 44 63 63 68 76 44 4b 75 66 73 70 76 6d 36 6c 70 41 63 39 48 43 71 61 47 43 69 43 4b 58 59 49 78 2f 30 4a 4c 6d 33 2b 6d 49 4c 6d 56 49 2f 52 35 4f 68 35 34 46 66 41 74 68 5a 43 48 79 72 66 37 38 50 67 38 45 4e 70 77 42 4f 67 39 56 78 71 7a 33 53 37 63 66 51 4c 30 33 4d 59 64 4e 44 75 32 4e 4c 2b 6d 75 56 68 2f 72 41 41 6d 72 35 48 35 47 4e 64 47 79 53 44 71 65 33 66 67 6d 65 75 4b 4d 78 36 79 67 39 6d 52 38 6e 58 32 6d 32 2f 31 68 65 5a 6c 59 4c 4d 48 35 41 45 72 2f 33 4e 78 75 75 33 63 50 45 5a 38 69 53 7a 35 41 65 2f 6e 44 77 49 38 49 6d 65 36 66 46 77 37 39 39 63 42 74 76 7a 54 41 61 5a 35 43 2b 57 65 63 67 36 39 43 61 65 4d 70 63 55 72 47 48 65 5a 34 65 36 44 4d 4e 42 2b 53 35 61 35 32 6a 2f 42 31 30 4f 36 54 5a 77 54 67 43 6e 33 35 6c 75 70 49 56 4f 62 53 4c 6a 38 4f 71 4b 59 52 4e 78 71 31 39 67 72 4e 56 49 59 44 78 41 37 78 48 43 61 46 32 4f 61 7a 6d 4b 76 43 44 71 68 6a 65 33 72 55 50 6f 2f 75 66 55 52 74 45 54 31 59 68 6f 6b 39 6d 6c 35 63 4c 59 45 79 41 4e 2f 73 69 4f 71 69 62 6b 39 4a 59 77 41 73 57 6c 48 68 41 66 63 56 6f 4d 59 6a 7a 4f 6e 34 38 50 39 6a 2b 47 66 6a 4b 46 55 48 54 46 51 6e 6d 71 6f 46 55 59 70 66 58 2b 31 4a 4f 6a 50 76 46 77 39 39 37 2b 77 4e 75 52 6e 48 79 51 4f 6f 73 63 32 64 5a 31 36 77 6b 44 31 66 59 51 73 52 49 47 64 66 4b 51 63 50 76 79 4c 4b 56 77 41 47 56 4a 72 45 48 36 44 62 4c 4a 46 6e 52 32 62 62 63 70 37 44 42 6c 7a 44 54 6f 52 4e 36 79 38 6a 49 2f 43 44 70 62 68 48 33 4c 67 34 51 37 36 4c 68 34 71 31 52 4f 49 6f 71 66 62 32 71 67 59 79 51 55 69 36 4d 57 39 4b 69 6d 71 46 35 49 65 74 53 55 67 6e 34 68 2f 66 45 31 46 7a 6e 6c 6b 47 77 74 6c 58 6a 2b 6a 70 7a 72 59 74 7a 78 65 57 48 38 69 65 2f 59 78 51 4c 45 72 70 35 72 68 75 65 61 70 53 43 2b 43 59 2f 67 77 66 34 31 37 68 33 37 4c 67 34 44 64 6a 0a 0a 68 6f 73 74 3b 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3b 78 2d 61 6d 7a 2d 64 61 74 65 3b 78 2d 61 6d 7a 2d 73 65 63 75 72 69 74 79 2d 74 6f 6b 65 6e 0a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35</CanonicalRequestBytes><RequestId>9DXNPP7VHGZNXGQA</RequestId><HostId>sQ1DKWl7iFcL3b+U0WbGiuchoKRB/6SRUBXje+T93FTUHdZ9D/kdNvz0FlGwCzOPGBlmiuRiwQA=</HostId></Error>

But I am able to download other files without having ":" in their names using the proxy :-

root@ip-10-30-11-182:~# curl -v -H 'host: s3.cn-northwest-1.amazonaws.com.cn' 'http://localhost:8080/dev-moderation.dev.viooh.net.cn/test-file-31-10-2023/testfile'
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /dev-moderation.dev.viooh.net.cn/test-file-31-10-2023/testfile HTTP/1.1
> Host: s3.cn-northwest-1.amazonaws.com.cn
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Content-Length: 19
< Content-Type: binary/octet-stream
< Date: Wed, 22 Nov 2023 08:35:57 GMT
< Etag: "32068f20af575b3703c4cfcb2078dfe5"
< Last-Modified: Tue, 31 Oct 2023 07:14:05 GMT
< Server: AmazonS3
< X-Amz-Id-2: 5jtlLE79R3+dm9DF6Ax8+1aisA98qWUHEZwHg8dE2mMnDY5VuGtsY9VRqz3OUuG9TuZK6Kf/Y5g=
< X-Amz-Request-Id: JBG5W7DQ2505X3WA
< X-Amz-Server-Side-Encryption: AES256
< X-Amz-Tagging-Count: 1
< 
This is test file 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant