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

webhook does not support the use of intermediate certificates #510

Closed
mcb30 opened this issue Mar 28, 2020 · 0 comments · Fixed by #515
Closed

webhook does not support the use of intermediate certificates #510

mcb30 opened this issue Mar 28, 2020 · 0 comments · Fixed by #515

Comments

@mcb30
Copy link
Contributor

mcb30 commented Mar 28, 2020

Affected Puppet, Ruby, OS and module versions/distributions

All versions

How to reproduce (e.g Puppet code you use)

Attempt to use any webhook server certificate that requires the use of an intermediate certificate. For example, using a certificate for the machine's FQDN issued by LetsEncrypt:

class { 'r10k::webhook::config':
  enable_ssl => true,
  public_key_path => "/etc/letsencrypt/live/${::fqdn}/fullchain.pem",
  private_key_path => "/etc/letsencrypt/live/${::fqdn}/privkey.pem",
}
class { 'r10k::webhook':
  require => Class['r10k::webhook::config'],
}

What are you seeing

Connections to the webhook fail TLS verification because the intermediate certificate is missing. For example:

$ gnutls-cli <fqdn> -p 8088
...
- Got a certificate list of 1 certificates.
- Status: The certificate is NOT trusted. The certificate issuer is unknown. 

What behaviour did you expect instead

Connections to the webhook should succeed. This requires the webhook to present the intermediate certificate(s) along with its own certificate.

Any additional information you'd like to impart

A pull request to fix this issue is ready and will be submitted shortly.

mcb30 added a commit to mcb30/puppet-r10k that referenced this issue Mar 28, 2020
The webhook service is currently limited to using a certificate
directly issued by a trusted CA; it will silently ignore any
intermediate certificates that are present in the certificate file.

The currently released versions of the Ruby OpenSSL libraries do not
provide any clean way to load a certificate chain from a file.  We
therefore split the file using the BEGIN/END markers as per RFC 7468,
and construct the certificate chain directly.

No tests are extended to cover this enhancement, since there is no
existing test coverage for the use of HTTPS certificates by the
webhook.  All current tests use plain HTTP via http://localhost:8088.

Fixes voxpupuli#510

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
mcb30 added a commit to mcb30/puppet-r10k that referenced this issue Mar 29, 2020
The webhook service is currently limited to using a certificate
directly issued by a trusted CA; it will silently ignore any
intermediate certificates that are present in the certificate file.

The currently released versions of the Ruby OpenSSL libraries do not
provide any clean way to load a certificate chain from a file.  We
therefore split the file using the BEGIN/END markers as per RFC 7468,
and construct the certificate chain directly.

No tests are extended to cover this enhancement, since there is no
existing test coverage for the use of HTTPS certificates by the
webhook.  All current tests use plain HTTP via http://localhost:8088.

Fixes voxpupuli#510

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
mcb30 added a commit to mcb30/puppet-r10k that referenced this issue Mar 29, 2020
The webhook service is currently limited to using a certificate
directly issued by a trusted CA; it will silently ignore any
intermediate certificates that are present in the certificate file.

The currently released versions of the Ruby OpenSSL libraries do not
provide any clean way to load a certificate chain from a file.  We
therefore split the file using the BEGIN/END markers as per RFC 7468,
and construct the certificate chain directly.

No tests are extended to cover this enhancement, since there is no
existing test coverage for the use of HTTPS certificates by the
webhook.  All current tests use plain HTTP via http://localhost:8088.

Fixes voxpupuli#510

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
mcb30 added a commit to mcb30/puppet-r10k that referenced this issue Mar 30, 2020
The webhook service is currently limited to using a certificate
directly issued by a trusted CA; it will silently ignore any
intermediate certificates that are present in the certificate file.

The currently released versions of the Ruby OpenSSL libraries do not
provide any clean way to load a certificate chain from a file.  We
therefore split the file using the BEGIN/END markers as per RFC 7468,
and construct the certificate chain directly.

No tests are extended to cover this enhancement, since there is no
existing test coverage for the use of HTTPS certificates by the
webhook.  All current tests use plain HTTP via http://localhost:8088.

Fixes voxpupuli#510

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
mcb30 added a commit to mcb30/puppet-r10k that referenced this issue Mar 30, 2020
The webhook service is currently limited to using a certificate
directly issued by a trusted CA; it will silently ignore any
intermediate certificates that are present in the certificate file.

The currently released versions of the Ruby OpenSSL libraries do not
provide any clean way to load a certificate chain from a file.  We
therefore split the file using the BEGIN/END markers as per RFC 7468,
and construct the certificate chain directly.

No tests are extended to cover this enhancement, since there is no
existing test coverage for the use of HTTPS certificates by the
webhook.  All current tests use plain HTTP via http://localhost:8088.

Fixes voxpupuli#510

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant