Skip to content

Fix Common Name for self-signed TLS certificate #461

Description

@WolfMa99

A self-signed TLS certificate is generated by an Ansible task running the required OpenSSL command. A certificate needs a common name, which should match the requested domain name.

Currently this common name is gathered from the hostname command, like this:

-subj "/C=US/ST=Oregon/L=Portland/O=IT/CN=${hostname --fqdn}"

But this "fails" and just generates a certificate with the literal text: ${hostname --fqdn}

I changed it to use an Ansible fact gathered beforehand, like: {{ ansible_facts["fqdn"] }}

WIth the help of that change the self signed certificate generation works fine and the common name matches the configured hostname.

This task would mostly be used for quick demos to spin Nextcloud and not need to worry about the TLS certificates yet. So this a minor detail. I hope it helped!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions