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

Wildcard custom certificates cannot be used for modules configuration #7004

Open
nrauso opened this issue Sep 3, 2024 · 1 comment
Open

Comments

@nrauso
Copy link

nrauso commented Sep 3, 2024

It is not possible to use a third-party wildcard SSL certificate provided by an external authority for configuring modules in NS8. When you upload a third-party certificate, the UI automatically detects the FQDNs included in it. In the case of a wildcard certificate, this means that all FQDNs in the DNS namespace (e.g., *.mydomain.org) are recognized:
third_party_cert01

However, this "special name" cannot be applied to any of the modules you install on an NS8 node, and the TLS certificates UI does not offer a way to manage this configuration.
Additionally, the settings page for any NS8 module includes an option to manage an LE certificate but does not allow the management of third-party certificates:
third_party_cert02

In conclusion, there is no way to manage a third-party wildcard SSL certificate within NS8 (and as far as I know, 99% of third-party certificates purchased from external authorities are wildcard certificates!).

At the moment, the workaround is to manually insert the necessary DNS names along with the private key and certificate from the external authority into the redis database.

Components

core:2.9.1
traefik:2.2.3

@nrauso nrauso added the bug label Sep 3, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in NethServer Sep 3, 2024
@nrauso nrauso self-assigned this Sep 3, 2024
@NethServer NethServer deleted a comment Sep 3, 2024
@nrauso nrauso removed their assignment Oct 3, 2024
@Amygos
Copy link
Member

Amygos commented Oct 17, 2024

Uploading a custom wildcard certificate prevents all subdomains from obtaining Let's Encrypt (LE) certificates.

Example:

[root@server ~]# cat  /home/traefik1/.config/state/configs/certificate-example.domain.com.yml 
http:
  routers:
    certificate-example.domain.com:
      entrypoints: https
      service: ping@internal
      rule: Host(`example.domain.com`) && Path(`//8b38cb85-451a-4795-a706-4b544d9cfd36`)
      priority: '1'
      tls:
        domains:
        - main: example.domain.com
        certresolver: acmeServer

Running the command to list certificates with api-cli shows that the example.domain.com subdomain fails to obtain its certificate, while others succeed:

[root@server ~]# api-cli run module/traefik1/list-certificates -d '{"expand_list":true}' | jq
Warning: using user "cluster" credentials from the environment
[
  {
    "fqdn": "mail.service.domain.com",
    "type": "internal",
    "obtained": true
  },
  {
    "fqdn": "example.domain.com",
    "type": "internal",
    "obtained": false
  },
  ...
  {
    "fqdn": "*.domain.com",
    "type": "custom",
    "obtained": true
  }
]

Testing port 443 returns the wildcard certificate instead of obtaining an LE certificate:

[user@local ~]$ curl -v https://example.domain.com
...
* Server certificate:
*  subject: CN=*.domain.com
*  start date: May 21 00:00:00 2024 GMT
*  expire date: Jan 31 23:59:59 2025 GMT
*  subjectAltName: host "example.domain.com" matched cert's "*.domain.com"

Problem:

  • Traefik doesn't request an LE certificate for subdomains if a wildcard certificate is installed.
  • acme.json is not updated, and the event of obtaining a certificate is never triggered.
  • If a module does not use port 443, it cannot acquire the certificate automatically.

@DavidePrincipi DavidePrincipi added this to the NethServer M8.3 milestone Nov 7, 2024
@gsanchietti gsanchietti removed the bug label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ToDo
Development

No branches or pull requests

4 participants