Currently I try to figure how to do the simplest s2s activity I can think of, a ‘Like’ and utterly fail.
I can’t find how to properly sign as neither the example by Eugen Rochko , Jun 23, 2018 nor noseing around in the sources of mastodon, peertube, lemmy or pixelfed brought success.
Originally I looked at the python code of Little Boxes, and used that as a starting point.
In addition to the signature header you will need to set Host and probably User-Agent. The receiving side may also look back and try to check your actor.
request-target looks wrong. I expect it should just be /inbox
host is the server that you are sending to. I don’t know about other instances, but Epicyon rejects anything addressed to localhost except if it is running unit tests.
The date is also important. There is a recency check to test that the post was sent within the last few minutes. 2018 is obviously older than that. This check is to avoid replay attacks.
Of course, none of the above is documented in the ActivityPub specification, and some people will fervently argue that this type of details should remain undocumented.
meanwhile the verification of the peertube test fixtures signatures is ok!
However, the real-world EU peertube still rejects my ‘Like’ with an 'ActivityPub signature could not be checked'. I suspect the profile json is the culprit but am lost .
@chocobozzz, your assistence is highly appreciated.