IPv6 and gemini

It was thus said that the Great plugd once stated:
> Hi all,
> 
> I've been having intermittent connection issues with some of the gemini
> servers.  While this is of course to be expected at this point, it
> seemed odd that, for instance, gemini://zaibatsu.circumlunar.space
> seemed to be offline more often than not.  I finally got around to
> looking at this more carefully, and noticed that using gnutls-cli to
> open a connection to the IPv4 address always succeeds, whereas
> connections to the IPv6 address that the resolver returns do not.
> Since the network that I'm using supports IPv6 and falls back to IPv4
> when necessary, this was causing a problem.
> 
> Furthermore, because of the requirement that clients transmit the full
> URL to the server, it's not trivial to get around this by just directing
> the client to the IPv4 address: the server probably won't recognise the
> URL and will respond with an error code.

  Worse than that:

[spc]lucy:~/projects/gemini/Lua>lua client.lua gemini://127.0.0.1/
ios:write() = name `127.0.0.1' not present in server certificate

  Of course, an option could be added to the client to overwrite the
hostname from the URL, so for example:

GenericUnixPrompt> geminiclient -h example.com gemini://127.0.0.1/

so it would use the IP address to connect, but instead of sending
'127.0.0.1' as the host, it would use the one passed in as an option.  That
might be easier said than done though [1].

> There seem to be four options:

  [ snip ]

> 4. Have servers ensure that if they have an AAAA record they also listen
> for IPv6 gemini connections.
>   - Pros: future-proof, no client-side changes necessary.
>   - Con: some additional work necessary on the server side.

  It depends.  On GLV-1.12556, all that takes is to use an address of "::"
to listen on all IPv4 and IPv6 interfaces, and that should work with any
modern IP stack.

  There is also a fifth option:

	5. Have clients attempt to connect to both addresses and use the one
	that connects first.
	- Pro: should always work
	- Con: complicates the client

> Obviously 4 is my favourite because it's less (no) work for me. :)

  I like 4 as well.

  -spc

[1]	Looking at my own very simplistic client and yeah, I would have to
	use a lower level API call to do that.  Ick.

---

Previous in thread (1 of 8): 🗣️ plugd (plugd (a) thelambdalab.xyz)

Next in thread (3 of 8): 🗣️ plugd (plugd (a) thelambdalab.xyz)

View entire thread.