making raw gopher and gemini requests ===================================== gopher's probably the easiest since it's in plain text (not encrypted). you're just sending the path you want to request and conneting to the hostname and port number that the gopher server is listening on. ``` # nc note: this is interchangable with telnet if you have it echo '/users/tftp/textfiles' | nc gopher.club 70 i[/users/tftp/textfiles/] TITLE null.host 1 i null.host 1 1.. /users/tftp/ sdf.org 70 0awk.txt 2026-Apr-19 10:59 2.5 KB /users/tftp/textfiles/awk.txt sdf.org 70 (snip) . gemini's a little trickier if it's over tls, so trying to communicate over port 1965 will just get the connect rejected. i've cribbed most of this from danq's post[1] ``` printf "gemini://gandalf/\r\n" | openssl s_client -ign_eof -connect gandalf:1965 CONNECTED(00000003) --- (omitting lot of the tls handshake and certificate verbosity) --- 20 text/gemini # bookmarks this is a bookmarks landing page for lagrange. (snip) ``` i don't have access to a spartan server (gemini without tls), but it looks closer to gopher's request path (and what the underlying gemini request looks like) ``` printf "danq.me /posts/gemini-without-a-browser 0\r\n" | \ curl telnet://danq.me:300 ``` also learnt about nmap's own version of netcat called ncat[2][3][4] which does tls/ssl (but requires a copy of the certs if self signed). additional reading (openssl is a handy tool for troubleshooting cert issues)[4] [1]: https://danq.me/2023/11/08/gemini-without-a-browser/ [2]: https://nmap.org/ncat/guide/ncat-ssl.html [3]: https://geekcabi.net/posts/using-ssl-connections-over-ncat/ [4]: https://tarnbarford.net/journal/securing-sockets-with-tls/ [5]: https://www.redhat.com/en/blog/6-openssl-commands