Hello Scott,

On 18 Oct 2011, at 13:25, Scott Sproule wrote:

> I wanted to send a note to a zinc mailing list about Amazon SES using zinc 
> and the stunnel configuration.  

Thanks for using Zinc.

> I was uncertain about the correct list.. Can you suggest one?

There is no mailing list for Zinc HTTP Components, if it is not too much 
trouble, you can use the Pharo list which I am reading every day (see CC).

> Bottom line is  that I spent about a day trying to get amazon ses working 
> with zinc.  I kep on getting authorization failed and was concerned that the 
> Amazon signature was wrong and spent a long time working with hash and hmac 
> functions.  THe solution was simpler...  I had to add the header Host at put 
> 'email.s-east-1.amazon.com
> 
> I think becuase of the url using the stunnel messed up the host value...
> 
> see below:
> 
> I had to add the following:
> 
> PARAMETERS
> params at: 'AWSAccessKeyId' put: credentials accessKey;
>       at: 'TimeStamp' put: credentials dateRFC1123;
>         at: 'Version' put:'2010-12-01';
>                       at:  'Signature-Version' put: '2';
>                     at: 'SignatureMethod' put: 'HmacSHA256';
>                       at: 'Action' put: self action.
> 
>         client := (ZnNeoClient new)
>                       url: 'http://127.0.0.1:20011/'; 
>                       headerAddAll: credentials getHeaders;
>                       headerAt: 'Host' put: 'email.us-east-1.amazonaws.com'.
>       self client
>                       formAdd: 'Destination.ToAddresses.member.1' -> 
> aDestination;
>                       formAddAll: self parameters.
>                       self client post.
>                       ^self client

I think I more or less understand. Indeed, when you go through stunnel, Zn will 
put 'localhost' in the Host: header, while AWS will be unhappy with this. It 
also might be important for the actual signature (I don't remember if Host: is 
included).

Thanks for the feedback, this might safe others a lot of time !

Is your code available somewhere on SqueakSource ?

I assume that you saw the 'Zinc-AWS' example that I did some time ago ?

Regards,

Sven



Reply via email to