Edent,
@Edent@mastodon.social avatar

I'm trying to accept a follow request from Mastodon.social, but the server keeps coming back with the error "found an invalid character in header name".

I'm sending my response to <https://mastodon.social/users/Edent/inbox>

What trivially obvious thing am I missing?

#MastoAdmin #ActivityPub #MastodonAPI

Edent,
@Edent@mastodon.social avatar

It is rather frustrating that there's no way to verify signatures online if they contain "(request-target)".

The server is responding to my server's "Accept" POST with "Verification failed".

As far as I can tell, my signature is valid. It uses the same generation code as other servers as far as I can tell.

This might be a 3-drink problem!

benpate,
@benpate@mastodon.social avatar

@Edent HTTP signatures are the worst. I’m so sorry you’re struggling with this. They’re so delicate, I can’t offer any help aside from the standard “break everything down into tiny steps, then test with known data at every step along the way.” Hopefully, something sticks out.

For me, HTTP sigs easily accounted for 1/3 of the overall pain of implementing ActivityPub. JSON-LD is another 1/3, btw…

So the (good news?) is that once you cross this hurdle, you’re VERY close. I’m rooting for you!

Edent,
@Edent@mastodon.social avatar

@benpate Thanks! Do you have any code I could look at?
I'm comparing PHP and Python at the moment. No obvious mistakes.

benpate,
@benpate@mastodon.social avatar

@Edent Hey Terence, I’m so sorry, I just saw this notification now. I’m working in Go, so my code may not be that useful to you. But in case it is:

All my ActivityPub code is here: https://github.com/benpate/hannibal
And my HTTP Signature code is here: https://github.com/benpate/hannibal/tree/main/sigs

Hopefully, some of my test cases will be useful for you :)
Let me know if anything pops out where I can help you out.

thisismissem,
@thisismissem@hachyderm.io avatar

@Edent could it be an issue with padding (the = signs)

thisismissem,
@thisismissem@hachyderm.io avatar
Edent,
@Edent@mastodon.social avatar

@thisismissem
Thanks!
Turns out it was PEBCAK. I was using my path rather than the remote path.
Perhaps I should have stuck to one drink 😄

naturzukunft,

@Edent https://funfedi.dev/testing_tools/http_signatures/ helps me to fix some bugs. At least it was successful. But the mastodon error is the same 😀 i need anybody with an mastodon instance who has access to its logfiles.

naturzukunft,
Edent,
@Edent@mastodon.social avatar

@naturzukunft
Brilliant, thanks!

bencurthoys,
@bencurthoys@mastodon.social avatar

@Edent I'd look for an unescaped [ character in one of the values being parsed as the start of a new header name.

naturzukunft,

@Edent The headername are also in the signature? Maybe the error occurs after extracting them ?

Edent,
@Edent@mastodon.social avatar

@naturzukunft
Good point, I'll try that. Thanks.

paul,
@paul@oldfriends.live avatar

deleted_by_author

  • Loading...
  • Edent,
    @Edent@mastodon.social avatar

    @paul
    In the kindest possible way - if you don't understand the question, please don't feel compelled to guess.

    sil,
    @sil@mastodon.social avatar

    @Edent try making the header names lower case? that ought to not be the problem, but occasionally I've seen things moan about it. Unlikely to be the issue with something as widely deployed as mastodon though!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • fediverse
  • DreamBathrooms
  • ngwrru68w68
  • cubers
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • JUstTest
  • osvaldo12
  • normalnudes
  • tester
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • anitta
  • Leos
  • provamag3
  • modclub
  • megavids
  • lostlight
  • All magazines