Add ability to handle sse-c with add-header#1004
Open
geraldhansen wants to merge 1 commit intos3tools:masterfrom
Open
Add ability to handle sse-c with add-header#1004geraldhansen wants to merge 1 commit intos3tools:masterfrom
geraldhansen wants to merge 1 commit intos3tools:masterfrom
Conversation
02059ed to
ccf94cb
Compare
c8315b4 to
84f4ad0
Compare
This will suppress md5-sum checks for sse-c uploaded and downloaded files. And use extra-headers also for get and info requests to download sse-c enrypted files again.
84f4ad0 to
c8660d4
Compare
|
I found a error: secret="12345678901234567890123456789012"
key=$(echo -n $secret | base64)
key_md5=$(echo -n $secret | openssl dgst -md5 -binary | openssl enc -base64)
s3cmd --add-header=x-amz-server-side-encryption-customer-algorithm:AES256 \
--add-header=x-amz-server-side-encryption-customer-key:"${key}" \
--add-header=x-amz-server-side-encryption-customer-key-MD5:"${key_md5}" \
--remove-header=x-amz-server-side-encryption put --acl-public test.txt s3://test-src/test6.txt -vvvv
INFO: No cache file found, creating it.
INFO: Compiling list of local files...
INFO: Running stat() and reading/calculating MD5 values on 1 files, this may take some time...
INFO: Summary: 1 local files to upload
WARNING: test.txt: Owner username not known. Storing UID=501 instead.
upload: 'test.txt' -> 's3://test-src/test6.txt' [1 of 1]
12 of 12 100% in 0s 349.80 B/s done
Public URL of the object is: http://ks3-bj.ksyun.com/test-src/test6.txt
s3cmd --add-header=x-amz-server-side-encryption-customer-algorithm:AES256 \
--add-header=x-amz-server-side-encryption-customer-key:"${key}" \
--add-header=x-amz-server-side-encryption-customer-key-MD5:"${key_md5}" \
--remove-header=x-amz-server-side-encryption get s3://test-src/test6.txt .
download: 's3://test-src/test6.txt' -> './test6.txt' [1 of 1]
ERROR: S3 error: 400 (MissingCustomerKey): The data is encrypted by customer key, but missing it in the request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there,
I like to use s3cmd for sse-c, for this I use the add-header parameter in this way:
This commit will suppress md5-sum checks for sse-c uploaded and downloaded
files. And use extra-headers also for get requests to download
sse-c enrypted files again.