I appreciate the wildcard domain feature and I use it for
flounder.online. However, I recently added a feature to flounder.online
that supports users adding their own custom domains. I have this setup
over http, but I'd like it cert creation worked easily and automatically
with this library for gemini. Right now as a workaround I have it pull
from a list of domains and call server.Register for each one on startup,
but this doesn't work dynamically (ie, I'd have to restart the server
every time a user adds a custom domain)
Let me know what you think. If you're interested, I may add a patch for
this
All the best,
Alex
I plan on making this possible by allowing you to register a responder
with the pattern "*".
One problem that I foresee is that we must create a certificate for
every single domain, which could be abused to fill up the server's
certificate storage. This is necessary since TLS certificates generally
cannot use "*" as the hostname, so we must create a certificate for
every hostname.
However, if "*" were allowed in the TLS certificate DNSName, or if
Gemini clients ignore the DNSName altogether and don't do any hostname
verification, then we would be able to store only one certificate for
all possible domains. This depends on the behavior of Gemini clients in
the wild.
Another possible solution is to simply check that the provided hostname
is registered with the service in the CreateCertificate callback to
avoid creating certificates for other hostnames. It should probably be
renamed to GetCertificate then.
I went ahead and implemented this feature.
To use it, call Server.Handle("*", Responder), and be sure to check the
hostname in Server.GetCertificate.
Let me know if you run into any issues.