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

Configure PKI ajp redirection to use "localhost" instead of "::1" #395

Closed
wants to merge 1 commit into from

Conversation

flo-renaud
Copy link
Contributor

@flo-renaud flo-renaud commented Jan 13, 2017

When ipa-server-install configures PKI, it provides a configuration file
with the parameter pki_ajp_host set to ::1. This parameter is used to configure
Tomcat redirection in /etc/pki/pki-tomcat/server.xml:

ie all requests to port 8009 are redirected to port 8443 on address ::1.

If the /etc/hosts config file does not define ::1 for localhost, then AJP
redirection fails and replica install is not able to request a certificate
for the replica. Using "localhost" instead works with IPv4 or IPv6.

https://fedorahosted.org/freeipa/ticket/6575

@tkrizek tkrizek self-assigned this Jan 13, 2017
@tkrizek
Copy link
Contributor

tkrizek commented Jan 13, 2017

The fix solves ticket #6575, but I once again encountered ticket #4291: In pure IPv6 environments, the CA fails to start at the end of IPA server installation. I'm not sure why that happens, since localhost does correctly resolve to ::1 when using getent hosts localhost.

Flo is investigating and trying to reproduce the issue.

@tiran
Copy link
Member

tiran commented Jan 13, 2017

Bad news, you are out of luck.

Dogtag uses its own LDAP connector, which in turn uses JSS (NSS bindings for Java) to provide TLS for LDAP. SSLSocket from org.mozilla.jss does not support AF_INET6 and is therefore limited to IPv4 connections, https://hg.mozilla.org/projects/jss/file/1a96a08e6f3d/org/mozilla/jss/ssl/SSLSocket.c#l443

The experimental branch of JSS has IPv6 support, https://hg.mozilla.org/projects/jss/file/c76470016016/org/mozilla/jss/ssl/SSLSocket.c#l593, though.

@tiran
Copy link
Member

tiran commented Jan 13, 2017

I have created ticket https://fedorahosted.org/pki/ticket/2575 to track the issue.

@flo-renaud
Copy link
Contributor Author

Hi @tomaskrizek,
I was not able to reproduce the master install issue. Here are my steps:
On the master:
ip addr del 127.0.0.1 dev lo
ip -4 addr del <ipv4 @> dev
edit /etc/hosts: remove the line 127.0.0.1 localhost ...
make sure ::1 localhost ... is defined
add a line <IPv6 @> hostfqdn shortname
setenforce 0
ipa-server-install ...
The install succeeds. Do you perform the same steps?

@pvoborni
Copy link
Member

Btw our goal is not to make pure IPv6 working - this was not tested even before the regression.

@pvoborni
Copy link
Member

Possible ways how to fix upgrades are outlined in https://bugzilla.redhat.com/show_bug.cgi?id=1398600#c48 and comment 49.

@tkrizek
Copy link
Contributor

tkrizek commented Jan 16, 2017

@flo You're right, I'm able to install the IPA server in IPv6 env now. I probably forgot some configuration beforehand.

@tiran That's odd. If JSS does not support IPv6 at all, why does ::1 work when IPv6 is enabled?

@tkrizek tkrizek added the ack Pull Request approved, can be merged label Jan 16, 2017
@flo-renaud
Copy link
Contributor Author

Please wait before merging this PR.

@pvoborni Endi suggests 2 possible strategies for the upgrade fix: either in IPA or in PKI. We need to pick one, and depending on the choice modify this PR accordingly.

@tiran
Copy link
Member

tiran commented Jan 16, 2017

@tomaskrizek Upstream doesn't support IPv6. @nkinder told me that our Fedora packages contain several patches. The patches are not yet in upstream. One of the patches adds IPv6 support. I have not checked if the patch provides IPv6 for both client and server sockets or just for SSLSocket.

@flo-renaud
Copy link
Contributor Author

This PR has been modified to be consistent with PKI fix for 2570. PKI now defines by default the AJP redirection to "localhost", meaning that we do not need any more to override this setting. Upgrade is also handled by PKI.

@stlaz stlaz removed the ack Pull Request approved, can be merged label Jan 24, 2017
@stlaz
Copy link
Contributor

stlaz commented Jan 24, 2017

Removed the ACK label since this is not yet reviewed.

@tkrizek
Copy link
Contributor

tkrizek commented Jan 25, 2017

Since the bug is completely fixed on the PKI side, shouldn't we bump the Requires to require the fixed version of PKI?

Installation in IPV6-only environment will not work without the updated PKI, since 127.0.0.1 was used as a default before 3a49b9b3738befc03914b0a96aad61f9650fb935.

@pvoborni
Copy link
Member

Yes, but in different patch please. PKI with the fix was not released yet. So it should not block review of this patch. We can leave the ticket open until it is bumped.

@tkrizek
Copy link
Contributor

tkrizek commented Jan 25, 2017

I submitted this patch to BZ#1398600 and BZ#1416481.

Waiting for the PKI release and bump of Requires to ack and merge upstream.

@HonzaCholasta
Copy link
Contributor

@pvoborni, there is no benefit in bumping Requires in a separate patch, as this patch is blocked by it anyway and cannot be pushed as is. Please update the current patch once the fixed pki-core is released.

When ipa-server-install configures PKI, it provides a configuration file
with the parameter pki_ajp_host set to ::1. This parameter is used to configure
Tomcat redirection in /etc/pki/pki-tomcat/server.xml:
    <Connector port="8009"
            protocol="AJP/1.3"
            redirectPort="8443"
            address="::1" />
ie all requests to port 8009 are redirected to port 8443 on address ::1.

If the /etc/hosts config file does not define ::1 for localhost, then AJP
redirection fails and replica install is not able to request a certificate
for the replica.

Since PKI has been fixed (see PKI ticket 2570) to configure by default the AJP
redirection with "localhost", FreeIPA does not need any more to override
this setting.
The code now depends on pki 10.3.5-11 which provides the fix in the template
and the upgrade.

https://fedorahosted.org/freeipa/ticket/6575
@flo-renaud
Copy link
Contributor Author

Hi,
PR updated with dependency on pki 10.3.5-11 (note that this package is currently available in fedora updates-testing only).

@tkrizek tkrizek added the ack Pull Request approved, can be merged label Feb 17, 2017
@MartinBasti MartinBasti added the pushed Pull Request has already been pushed label Feb 17, 2017
@MartinBasti
Copy link
Contributor

@MartinBasti
Copy link
Contributor

Please create a backport PR for IPA 4.4.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
7 participants