Hi, Todd!
Thanks for your reply.
To be honest, I've never built the kernel or world for OpenBSD... But
that would be a good start to try.
I'll spin up another VM with such an environment and will report back.
(Since I see that there's an implementation within the acme-client code,
which you replied -> isn't there an existing library somewhere in
OpenBSD that can break up a URL in it's compositional parts? This looks
like acme-client reinvented the wheel... :) )
Best regards,
Ronald
On 6/4/23 16:35, Todd C. Miller wrote:
Can you try the following diff to acme-client that adds support for
parsing a port number after the hostname?
If we decide to go this route we may wish to support a service name
in addition to a port number and IP addresses bracked with '[' and
']' but first things first.
- todd
Index: netproc.c
===================================================================
RCS file: /cvs/src/usr.sbin/acme-client/netproc.c,v
retrieving revision 1.33
diff -u -p -u -r1.33 netproc.c
--- netproc.c 14 Dec 2022 18:32:26 -0000 1.33
+++ netproc.c 4 Jun 2023 14:27:25 -0000
@@ -19,6 +19,7 @@
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -124,6 +125,15 @@ url2host(const char *host, short *port,
warn("strdup");
free(url);
return NULL;
+ }
+
+ /* Check for optional port. */
+ if ((ep = strrchr(url, ':')) != NULL) {
+ short urlport = strtonum(ep + 1, 1, SHRT_MAX, NULL);
+ if (urlport != 0) {
+ *ep = '\0';
+ *port = urlport;
+ }
}
return url;