Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MDPortMap for virtual hosts, or disable the port check #133

Closed
mkauf opened this issue Aug 21, 2019 · 7 comments
Closed

Allow MDPortMap for virtual hosts, or disable the port check #133

mkauf opened this issue Aug 21, 2019 · 7 comments

Comments

@mkauf
Copy link
Contributor

mkauf commented Aug 21, 2019

Multiple virtual hosts can listen on different IP addresses, so the port mapping may differ for each virtual host. Currently "MDPortMap" is a global setting.

It would be an improvement to have the "MDPortMap" setting for each virtual host. But then mod_md also needs to check whether there are contradicting port mappings for virtual hosts that are on the same IP address, so this would make the code more complex.

An easier solution would be a new configuration setting to disable the port check, so that mod_md just assumes that all managed virtual hosts are reachable for Let's Encrypt. We could call this setting "MDPortCheck".

@icing
Copy link
Owner

icing commented Aug 21, 2019

I agree that MDPortMap currently has a too simplistic view for multi-homes hosts settings.

With the abolishment of the 'tls-sni-01' challenge, all current challenges use the domain to be verified either in Host: or SNI. That means the port number itself is not really interesting, only the fact of the domain can be used in http: and/or https: requests/connections.

Currently, a configuration of MDPortmap http:80 just adds http-01 challenge types to the options available and nothing more. It is overly specific. Something like

MDPublicAccess http https
MDPublicAccess none

would maybe serve better, configurable global or per MDomain.

I think I draw the line at MDomains where individual VirtualHost vary in accessibility. Such a setup can be done, but that leads to overcomplications in the module. Split such an MDomain in two, I would recommend.

What do you think?

@mkauf
Copy link
Contributor Author

mkauf commented Aug 21, 2019

I like this idea 👍 It's easy to use and powerful enough.

@icing
Copy link
Owner

icing commented Aug 22, 2019

Hmm, I think I need to backtrack a bit here. This is a larger change than thought at first.

Right now, mod_md uses the http: and https: ports also to make a guess if a VirtualHost uses SSL or not. Which is not really correct in all cases as well. I have an idea how to have a more reliable detection without specifying ports, but that does not fit on the margins of this page...

@icing
Copy link
Owner

icing commented Sep 5, 2019

Ok, after more work and more thinking and reading your first post again, I think it has less complexity and the same freedom if users of such multi-homed setup configured the challenges directly.

So, if you have an MD that might look available to other challenges, but is not, you configure

MDCAChallenges http-01

for it and no other method will be used. mod_md will also refrain from questioning your choice. So, it will not try to be smart and check ports in such cases. The auto-configuring out the challenges to use (and port checks on availability) will only run when no challenges are specified.

This allows also for some esoteric setups. For example you can have a separate http: server that just answers challenges, using the thumbnails of account keys.

WDYT?

@mkauf
Copy link
Contributor Author

mkauf commented Sep 6, 2019

Sounds good! Configuring the challenges needs some knowledge about which ACME challenges work in which cases. The documentation is a bit outdated, it does not explain that tls-alpn-01 is for port 443, see the "prerequisites" section on https://httpd.apache.org/docs/trunk/mod/mod_md.html

With updated documentation, I think that's a good solution 👍

@icing
Copy link
Owner

icing commented Sep 12, 2019

Ok, updated README and the Apache documentation in trunk. Although, I can describe this particular behaviour there only after copying the 2.1 over.

I leave this issue open until this has happened.

@icing
Copy link
Owner

icing commented Oct 16, 2019

Updated in Apache subversion in r1868506.

@icing icing closed this as completed Oct 16, 2019
mkauf added a commit to mkauf/mod_md that referenced this issue Nov 6, 2019
When the challenge "tls-alpn-01" is pre-configured with MDCAChallenges,
mod_md should not check any ports and just set up the challenge.

This is a follow-up to icing#133
mkauf added a commit to mkauf/mod_md that referenced this issue Jan 8, 2020
For "tls-alpn-01" challenges, mod_md checks whether there is a server
that supports the "acme-tls/1" protocol.

If the challenge "tls-alpn-01" is pre-configured with MDCAChallenges,
the ports of the servers are ignored (see issue icing#133). If there are
multiple servers matching a domain name, don't just look at the first
server but search one that supports the "acme-tls/1" protocol.

This is a follow-up to icing#159 and
icing#133
mkauf added a commit to mkauf/mod_md that referenced this issue Jan 8, 2020
For "tls-alpn-01" challenges, mod_md checks whether there is a server
that supports the "acme-tls/1" protocol.

If the challenge "tls-alpn-01" is pre-configured with MDCAChallenges,
the ports of the servers are ignored (see issue icing#133). If there are
multiple servers matching a domain name, don't just look at the first
server but search one that supports the "acme-tls/1" protocol.

This is a follow-up to icing#159 and
icing#133
mkauf added a commit to mkauf/mod_md that referenced this issue Jan 8, 2020
For "tls-alpn-01" challenges, mod_md checks whether there is a server
that supports the "acme-tls/1" protocol.

If the challenge "tls-alpn-01" is pre-configured with MDCAChallenges,
the ports of the servers are ignored (see issue icing#133). If there are
multiple servers matching a domain name, don't just look at the first
server but search one that supports the "acme-tls/1" protocol.

This is a follow-up to icing#159 and
icing#133
tlhackque pushed a commit to tlhackque/mod_md that referenced this issue Mar 6, 2020
When the challenge "tls-alpn-01" is pre-configured with MDCAChallenges,
mod_md should not check any ports and just set up the challenge.

This is a follow-up to icing#133
tlhackque pushed a commit to tlhackque/mod_md that referenced this issue Mar 6, 2020
For "tls-alpn-01" challenges, mod_md checks whether there is a server
that supports the "acme-tls/1" protocol.

If the challenge "tls-alpn-01" is pre-configured with MDCAChallenges,
the ports of the servers are ignored (see issue icing#133). If there are
multiple servers matching a domain name, don't just look at the first
server but search one that supports the "acme-tls/1" protocol.

This is a follow-up to icing#159 and
icing#133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants