proxy: allow multiple proxy blocks, matching options and validations as a side effect the order of the content of a server block is relaxed: options, location or proxy blocks can be put in any order.

simplify the proxying code it doesn't make any sense to keep the proxying info per-location: proxying only one per-vhost. It can't work differently, it doesn't make sense anyway.

support optional client certificate for proxy rule

add ability to proxy requests Add to gmid the ability to forwad a request to another gemini server and thus acting like a reverse proxy. The current syntax for the config file is server "" { ... proxy relay-to host:port } Further options (like the use of custom certificates) are planned. cf. github issue #7

free OCSP path when clearing the config was forgotten in ff05125eb81e5bbf2cf05b8434d03bce584936e0


Implement OCSP stapling support Currently dogfooding this patch at To test, run the following command and look for the "OCSP response" header: openssl s_client -connect "" -status

two -n to dump the parsed configuration This adds a barebone dumping of the parsed configuration. It is not complete, but I'm interested in dumping the full path to `cert' and `key' in order to write some scripts that can inspect the configuration, extract the certificates and renew them when expired automatically. It's not easy to parse gmid configuration otherwise because the syntax is flexible and users can use macros. Instead, the idea is to run gmid and let it dump the configuration once it's been parsed in a static and predictable format. Now is possible to parse gmid configuration with, say, awk or perl.

print the error too if we can't open a directory It's not intuitive to print open ... for domain xyz it doesn't convey that the open failed. now it appends the error string, at least the user can understand that something went wrong. reported by cage on irc, thanks!

one FastCGI connection per client FastCGI is designed to multiplex requests over a single connection, so ideally the server can open only one connection per worker to the FastCGI application and that's that. Doing this kind of multiplexing makes the code harder to follow and easier to break/leak etc on the gmid side however. OpenBSD' httpd seems to open one connection per client, so why can't we too? One connection per request is still way better (lighter) than using CGI, and we can avoid all the pitfalls of the multiplexing (keeping track of "live ids", properly shut down etc...)


use memset(3) rather than bzero(3) There's no difference, but bzero(3) says STANDARDS The bzero() function conforms to the X/Open System Interfaces option of the IEEE Std 1003.1-2004 (“POSIX.1”) specification. It was removed from the standard in IEEE Std 1003.1-2008 (“POSIX.1”), which recommends using memset(3) instead. so here we are.

don't crash if -n is given without -c If -n is given without -c, config_path is still NULL and it would crash due to a NULL deference.

unbreak configless mode An un-initialized field in the configless code path leads to a crash on the first request.

move parse_portno to gmid.c it's used only to parse the -p flag. While there add check_port_num to check the range for the port.