pfSense Support Subscription

Author Topic: ACME with standalone HTTP on IPv6 for HAPROXY  (Read 137 times)

0 Members and 1 Guest are viewing this topic.

Offline pmisch

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +1/-0
    • View Profile
ACME with standalone HTTP on IPv6 for HAPROXY
« on: November 23, 2017, 04:09:08 pm »
Hi,

as I got a static /64 prefix on my firewall's WAN side I have plenty of addresses to spare which I intend to use per service for a combination of an haproxy or squid ... together with ACME challenging this specific service based IPv6 address.

I have port 443 on the firewall itself already in use (DNAT) for v4 while v6 is 100% free.
Port 80 on the other hand as it looks is hard coded  >:( to listen on any address on both v4 and v6. That's what Diagnostics - Sockets tell me and I can't find a way to either stop listening on port 80 or tell which specific IP to listen on.
BTW That's why issuing a certificate fails as I chose "standalone HTTP server".
It says
Code: [Select]
[Thu Nov 23 22:48:57 CET 2017] nc listen error.
[Thu Nov 23 22:48:57 CET 2017] usage: nc [-46DdEFhklNnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]
[-P proxy_username] [-p source_port] [-s source] [-T ToS]
[-V rtable] [-w timeout] [-X proxy_protocol]
[-x proxy_address[:port]] [destination] [port]
nc: Address already in use
Well, even then it might as well be possible for nc to listen only for the specific IPv6 service address by using the
Code: [Select]
-s Switch.

TLDR;  ::)
I don't care for v4, how can I manage multiple IPv6 addresses / Hostname combinations to be handled by the acme client while on the other hand haproxy uses that very IP for the its HTTPS balancing?  :o

I love v6, did I mention that?

Offline pmisch

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +1/-0
    • View Profile
Re: ACME with standalone HTTP on IPv6 for HAPROXY
« Reply #1 on: November 24, 2017, 06:18:28 pm »
I managed to get port 80 free so way to go for requesting my cert.
Well, no, nc just listens on port 80 tcp4 instead of also tcp6? That's just mean. :-\
I wasn't able to figure out exactly why that is.
It's in /usr/local/pkg/acme/acme.sh while the _startserver() function seems to be the part where the http server is being invoked.
I set ncaddr manually to my desired IPv6 address. Now it's listening and my cert is being issued.
First try with acme testserver it still showed timeout. Gotta report a bug I guess.

Edit:
Here's the bug report.
https://redmine.pfsense.org/issues/8126
« Last Edit: November 25, 2017, 07:08:31 am by pmisch »