In my case this error was caused by extra space after colon in "x-amz-server-side-encryption: AES256". After I removed the space, the request started working.
In my case this error was caused by extra space after colon in "x-amz-server-side-encryption: AES256". After I removed the space, the request started working.