💾 Archived View for bbs.geminispace.org › s › misfin › 19318 captured on 2024-12-17 at 15:05:17. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

My misfin server is up now!

I don't have a client written yet though. I wrote the server from scratch, so it might be buggy or possibly crash. It should accept Misfin B and C messages.

The server (along with my gemini capsule) might be down in a few days due to physical infrastructure maintanance, but it is currently up and should be for at least the next 24 hours unless it crashes. If it stays up today, the following link is my misfin address.

misfin address - vi@vigrey.com

Once I get a simple enough client written, I will probably write a gemlog post about the process and complications of making the misfin server and client.

Posted in: s/misfin

☀️ vi

Sep 02 · 3 months ago · 👍 skyjake, CitySlicker, 50lo, random2934, Aptor-theHobbit

20 Comments ↓

🕹️ skyjake [mod...] · Sep 02 at 15:21:

I tried sending you a message but your server replied that my certificate was invalid. I have previously successfully used the certificate with other servers and I don't think there is anything wrong with it...

Just a heads up if this was an unexpected result. It's nice to see Misfin implementations popping up!

☀️ vi [OP] · Sep 02 at 19:33:

@skyjake Is your client cert signed by your server cert? I'll probably need to relax my certificate testing and temporarily store the client and server TLS certs for debugging purposes. Hopefully that will be finished within the hour.

🕹️ skyjake [mod...] · Sep 02 at 19:45:

Ah, it is not signed by the server cert. Re-reading that part of the spec, it does suggest doing that if the server hosts multiple mailboxes. I only have a single mailbox so it is unclear if the signing is necessary in this case...?

I suppose signing with the server cert would be a good idea in any case.

☀️ vi [OP] · Sep 02 at 19:55:

With this part of the spec

the Misfin server may perform a single blank request to the sender's host, and store its certificate. That stored certificate can then be used to verify the certificates of senders purporting to be from that host.

I interpreted it as:

That seems to also imply to me that if there is only 1 cert (server and client use the same cert) it should be self signed, otherwise sign the client cert with the server cert.

Hooray ambiguity!

☀️ vi [OP] · Sep 02 at 20:11:

I suppose until the ambiguity gets figured out, I can

That can lead to an infinite loop issue though where the servers keep trying to verify each other, so to break that, I'll need to just accept every 0 size misfin message.

I'm almost positive my interpretation in the previous comment is correct to avoid that infinite loop, but this will handle the ambiguity

🕹️ skyjake [mod...] · Sep 02 at 20:54:

I generated a new Misfin certificate that is now signed by my server certificate. It appears your server now accepts my identity. However, when sending a message to a new recipient in Lagrange, it will first send an empty message to verify that the mailbox exists and to record the mailbox fingerprint. Your server seems to be responding "invalid message" to this initial zero-content-length message I'm making.

☀️ vi [OP] · Sep 02 at 21:07:

@skyjake I should have that stuff fixed hopefully soon today. I'll do another comment when that stuff should be set up. Thanks for helping me figure out edge cases I wasn't expecting from my reading of the spec.

☀️ vi [OP] · Sep 02 at 23:18:

@skyjake well, my code is now more complicated and gross looking than I'd like, but I believe I have all of the ambiguity in verification and blank message stuff working. I also cleared out the stored fingerprints so having a different cert now that it's signed shouldn't cause any issues on my server (although your cert might now cause issues on other servers you have already messaged)

🐐 satch · Sep 03 at 00:15:

@vi I’m looking forward to hearing your notes, and glad we found this ambiguity. I will say that as at the moment I’m the person hosting the Misfin C spec, the way updates are being made is through conversation in ##misfin on libera.chat IRC. So please join that channel to share your feedback and we can discuss and clarify the spec accordingly.

🕹️ skyjake [mod...] · Sep 03 at 06:02:

I think I'll keep my new cert since I think it's generally beneficial if Misfin identities are signed by the server.

@satch Does your server handle updating changed fingerprints in any way? Not sure of the security implications, but it could ask the sender's server again to see if the new fingerprint matches the mailbox fingerprint.

@vi I sent a new test message and this time it passed the initial mailbox query step but your server responded "Invalid request" when actually delivering the message.

☀️ vi [OP] · Sep 03 at 15:32:

@skyjake AAAAAAA I don't know what would have gone wrong this time... time to take the server down and do more testing, the problem is I don't know what I'm testing for now...

☀️ vi [OP] · Sep 03 at 16:04:

Took me a bit to figure out how to get lagrange compiled, but am now testing on 1.18. Will hopefully be able to bugtest faster this way.

🕹️ skyjake [mod...] · Sep 03 at 16:18:

@vi Nice. It is entirely possible there are bugs in Lagrange, too, since this is very fresh code. Let me know how it goes!

☀️ vi [OP] · Sep 03 at 17:59:

@skyjake It was so much easier to fix things once I got 1.18 built! I'll send you a misfin message via 1.18 quick as a test. My server should be up for a while today, but due to electrical work that needs to be done soon, it'll be down whenever the game of phone tag with the electrician gets settled.

☀️ vi [OP] · Sep 03 at 18:33:

@skyjake Heh, now I'm running into an invalid certificate error because my cert had 2 hostnames in it (my .com and .onion domain names). Because of that, I had to make a new cert with only the 1 hostname, but now your server is grumpy because the cert changed :P Everything should be good once your server and client clear my mailbox's cert fingerprint.

Thanks for all the help! Sorry things got complicated. I feel like we all learned some things these last few days heh. Things should be good and functioning now (I know I said that like 12 times already, but I feel it in my bones this time!) once my old fingerprint is cleared out of your client and server.

🕹️ skyjake [mod...] · Sep 03 at 18:43:

This is what testing is for, haha. Thanks to your double DNS record, I discovered a bug in the GmCapsule Misfin extension! It should now parse multiple domains correctly, assuming of course that the intended domain name is the first one listed in the certificate.

You should try sending again. I'm not seeing your fingerprint in the list of trusted senders yet, so the DNS parsing failure must have prevented it from being saved.

☀️ vi [OP] · Sep 03 at 18:59:

@skyjake I think I was getting a hostname error in lagrange itself when I had more than DNS record. Could be worth testing in the future, but for now I'll just keep this single domain misfin client cert. I believe my message got to you and another to @satch!

Edit: Actually, thinking about it, it was probably the server. Ah well, the cert is gone, so time to make another one... that means both of yall would need to clear my cert fingerprint. Yeah... it would be good to come up with a recommendation for handling changed client certs... especially considering new folks who do dogfooding might mess up their misfin client cert initially compared to a gemini server cert.

☀️ vi [OP] · Sep 03 at 19:23:

@skyjake @satch Okay, I set up the new cert. Sorry to make yall have to delete things so much! Also @skyjake, I think the Misfin B is specifying that the total request size is within 2048 bytes, not just the message. Looks like I have quite a bit to do a writeup on... hopefully I'll have something published within a week. Just gotta download specific text resources and gather my thoughts.

☀️ vi [OP] · Sep 03 at 19:32:

@skyjake considering when I write a message in lagrange 1.18 and have dealt with failed messages (as have you trying to send me message) and we still get a copy of our own message, I have 2 recommendations.

🕹️ skyjake [mod...] · Sep 04 at 03:40:

@vi I've cleared your fingerprint on my server.

Misfin B is specifying that the total request size is within 2048 bytes

You are correct of course, and that's how the code is implemented. Not sure what I was thinking there...

Have the copy sent to your own mailbox AFTER the original is sent

Makes sense, yes, considering the delivery error situation. I was also planning to add a toggle whether to CC self or not, although I would imagine most people would want a record of what they sent because Lagrange doesn't keep a copy itself.