sailthru / sailthru-node-client

Sailthru Node.js client
http://docs.sailthru.com
MIT License
17 stars 15 forks source link

Signature hash does not match #2

Closed malkomalko closed 12 years ago

malkomalko commented 12 years ago

Hi There,

In production in my logs, every once in a while I see something that looks like this:

8 Feb 14:12:32 - sailthru-client 1.0.4 - POST Request 18 Feb 14:12:32 - sailthru-client 1.0.4 - Status Code: 401 Status Code: 401 Error Code: 5 Error Message: Signature hash does not match

Haven't been able to find much information on this.. seems like some auth mismatch?

infynyxx commented 12 years ago

Hmm, that's interesting.

Can you log data parameters to a file whenever you encounter 401? That would make it, easier to debug.

malkomalko commented 12 years ago

sure.. I'll add that logging and report back here.

malkomalko commented 12 years ago

I sent you a private message with a gist that has some logging of paramesters.

I've been looking at the SailthruUtil.getSignatureHash function and even noticed a post on something similar here: https://github.com/sailthru/sailthru-php5-client/issues/4

It appears that some of the payloads are getting hashed incorrectly. On your side how are you validating the hash? Anyway, let me know if I can be of anymore assistance.. I'm sure it's something silly.

BTW, I'm running this with node 0.6.10. Cheers!

malkomalko commented 12 years ago

fixed with https://github.com/sailthru/sailthru-node-client/commit/722cbcce6a6e34e3364133c66981dd8200b6d097

desmondmorris commented 9 years ago

@malkomalko I am experiencing this issue on one Ubuntu box. Tested on node 10.32, 10.36 and 12.2. Could it be an issue with openSSL on the machine?

desmondmorris commented 9 years ago

nvm - You will also get this is error if you do not pass the secret key to the constructor.