Skip to content

SSL certificate not found #397

@tjoedden

Description

@tjoedden

If there's an nginx::resource::vhost tag with more than two vhost addresses, the ssl certificates cannot be found.
this is because the regsubst function in vhost.pp line 326 to sanitize the copied ssl certificate filenames only replaces the first whitespace of the vhost name to form the certificate filename:
$name_sanitized = regsubst($name, ' ', '_')

Better would be something like:
$name_sanitized = regsubst($name, ' ', '_', 'G') # all whitespaces replaced
or even better
$name_sanitized = regsubst($name, /\W/, '_', 'G') # all non-word characters replaced

this should be checked against the gsub replacements in the vhost_ssl_header.erb template as well - right now all whitespaces are replaced there which is the cause why this failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions