title: Amazon S3: Strange Error -' Sometimes' SignatureDoesNotMatch, sometimes it does
body: <p>I am developing code for salesforce. We are using 'Force.com for Amazon Web Services' App from Appexchange. The app is provided by Amazon.</p>
  
  <p>I am downloading files from Amazon S3 on a machine. </p>
  
  <p>Sometimes I am getting the below mentioned error. Interesting thing is, only sometimes I get this error, rest of the times it works, even for the same file.</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;
  &lt;Message&gt;
  The request signature we calculated does not match the signature you provided. Check your key and signing method.
  &lt;/Message&gt;
  </code></pre>
  
  <p>I tried using both URL patterns provided by Amazon. Expires is set for 1hr after link generation, hence may not be an issue.</p>
  
  <pre><code>URL1:- http://adminportal.s3.amazonaws.com/sample.pdf?AWSAccessKeyId=AKIAIRUZSRRCVSLXZCIA&amp;Expires=1372653478&amp;Signature=RvMJ1gJL+qNKmnRkqzuytmlUTGQ=
  URL2:- http://s3.amazonaws.com/adminportal/sample.pdf?AWSAccessKeyId=AKIAIRUZSRRCVSLXZCIA&amp;Expires=1372658253&amp;Signature=%2FmI0m0PTlHJpJ%2FP5d%2FX3OApqzcI%3D
  </code></pre>
  
  <p>The signature is generated by class provided by Amazon, I guess it must work well all of the times.</p>
  
  <p>Can someone elaborate why would S3 give this error only sometimes?</p>