Commit Briefs
first draft of client certificate support
At the moment telescope loads a mapping host:port/path -> certificate from a file and always uses it, no ways to change it, use a temporary one, generate a new one, etc are provided yet. The format of ~/.telescope/certs/certs is host port path certificate file name where the certificate file name is the name of a file inside ~/.telescope/certs. ~/.telescope/certs/ is ~/.local/share/telescope/ when using XDG.
rework net_read() a bit
- don't stop after parsing the header maybe there's some page data in the buffer, let's try to forward it immediately too. - use a local buffer plus bufferevent_read()
net: don't need a uri, just host and port fields
While here, make 'em dinamically allocated.
re-group the handling of imsgs
while here also do more validation in IMSG_GET_RAW and add a missing NULL check in the return type of req_by_id in the IMSG_CERT_STATUS.
get rid of some ifdefs
just declare the same function in the two branches of #if HAVE_ASR_RUN to avoid further #ifs
work around macos lack of SOCK_CLOEXEC / SOCK_NONBLOCK
rework mark_nonblock so it sets the cloexec flag too and use it in control.c to avoid these flags. (which are expected to become available on a future revision of POSIX and are already widely available.) It's not an issue for telescope to do the socket/accept + fcntl dance because there aren't threads that can fork(2) (there are no threads at all!) reported by @sikmir at github https://github.com/omar-polo/telescope/commit/59ef79dd19611c7846b00427e6f2267c748ae290#r74498414