amazon web services – Error executing “PutObject” on AWS SDK Version 3.298.10

I am using AWS SDK PHP Library for pushing files to AWS S3 bucket. After upgrading AWS SDK PHP version from 3.239.1 to 3.298.10, it is throwing below error

Error executing “PutObject” on “https://S3bucket/testfile.txt”; AWS HTTP error: Client error: PUT https://S3bucket/testfile.txt resulted in a 400 Bad Request response:

  <?xml version="1.0" encoding="UTF-8"?>
  <Error>
   <Code>AuthorizationHeaderMalformed</Code>
   <Message>The authorization header (truncated...)
   AuthorizationHeaderMalformed (client): The authorization header is malformed; a non-empty Access Key (AKID) must be provided in the credential. - <?xml version="1.0" encoding="UTF-8"?>
  <Error>
   <Code>AuthorizationHeaderMalformed</Code>
   <Message>The authorization header is malformed; a non-empty Access Key (AKID) must be provided in   the credential.</Message>
   <RequestId>Id</RequestId>
   <HostId>HostId</HostId>
</Error>

I am able to push files with 3.239.1 version but not with 3.298.10

Read more here: Source link