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

Wildcards and sans issue #39

Open
philrumble-fz opened this issue Mar 9, 2021 · 1 comment
Open

Wildcards and sans issue #39

philrumble-fz opened this issue Mar 9, 2021 · 1 comment

Comments

@philrumble-fz
Copy link

When i use a combination of a cert_common_name of "blank.com" and a sans of "*.blank.com" , I see that 2 dns challenges are created but with the same dns record name and thus the second overwrites the first. and the first check then fails.

Am I using an invalid combination?

vars:

  • ler53_cert_common_name: "blank.com"
  • ler53_route_53_domain: "blank.com"
  • ler53_cert_sans:
    • "*.blank.com"
  • ler53_cert_dir: "/etc/ssl/blank.com"

TASK [mprahl.lets-encrypt-route-53 : create the DNS records for the challenge] ***************************************************************************************************************************************************************
changed: [test] => (item={'key': 'blank.com', 'value': {'tls-alpn-01': {'resource': 'blank.com', 'resource_original': 'dns:blank.com', 'resource_value': '8bJD3fa1JmzuoyEYpzVd9zDICsZru7k6bbtUDLdWafk='}, 'http-01': {'resource': '.well-known/acme-challenge/A75Pwn-cuUsELpeTfQaQ5D2datp8vQTwV5LHMoldFjw', 'resource_value': 'A75Pwn-cuUsELpeTfQaQ5D2datp8vQTwV5LHMoldFjw.t6KTBXo2h8CY2pO30DrU3B0dnCRJ5TBoESM1m4cXv_0'}, 'dns-01': {'resource': '_acme-challenge', 'resource_value': '8bJD3fa1JmzuoyEYpzVd9zDICsZru7k6bbtUDLdWafk', 'record': '_acme-challenge.blank.com'}}})
changed: [test] => (item={'key': '*.blank.com', 'value': {'dns-01': {'resource': '_acme-challenge', 'resource_value': 'zR5p-CLkvUvrQofnIv-yM7BXG388AScoK98kmJeeOlI', 'record': '_acme-challenge.blank.com'}}})

TASK [mprahl.lets-encrypt-route-53 : validate the Let's Encrypt challenge] *******************************************************************************************************************************************************************
fatal: [test]: FAILED! => changed=false
msg: 'Authorization for dns:blank.com returned invalid: CHALLENGE: dns-01 DETAILS: Incorrect TXT record "zR5p-CLkvUvrQofnIv-yM7BXG388AScoK98kmJeeOlI" found at _acme-challenge.blank.com;'
other: {}

@LunaticZorr
Copy link

I'm runnign into the same issue.

This is how I run it:

- name: Generate an SSL certificate
  hosts: all
  become: yes
  pre_tasks:
    - include_vars:
        dir: ../vars
        files_matching: vault.yml

  vars:
  - ler53_cert_common_name: "api.sub-{{ my_env }}.domain.cloud"
  - ler53_route_53_domain: "sub-{{ my_env }}.domain.cloud"
  - ler53_cert_sans : 
      - "*.api.sub-{{ my_env }}.domain.cloud"
  - ler53_cert_dir: "/etc/ssl/env-cert/"
  - ler53_key_file_name: "env-cert.key"
  - ler53_cert_file_name: "env-cert.crt"
  - ler53_csr_file_name: "env-cert.csr"
  - ler53_intermediate_file_name: "env-cert.intermediate.pem"
  - ler53_cert_and_intermediate_file_name: "env-cert.pem"
  - ler53_aws_access_key: "{{ aws_access_key_id }}"
  - ler53_aws_secret_key: "{{ aws_secret_access_key }}"
  - ler53_new_cert_when_csr_changes: true

  roles:
  - role: mprahl.lets-encrypt-route-53
    when: "'env-waf' in inventory_hostname"

And it fails with

TASK [mprahl.lets-encrypt-route-53 : validate the Let's Encrypt challenge] *****
task path: /tmp/awx_11145_hne_hd6s/project/playbooks/roles/mprahl.lets-encrypt-route-53/tasks/main.yml:175
fatal: [env-waf-1]: FAILED! => {"changed": false, "msg": "Authorization for dns:api.sub-dev.domain.cloud returned invalid:  CHALLENGE: dns-01 DETAILS: Incorrect TXT record \"B4_6F3rrXqWLDtsAOVzqqP97NLzh4di2VH_bgIqjDwc\" found at _acme-challenge.api.sub-dev.domain.cloud;", "other": {}}

Removing the following:

  - ler53_cert_sans : 
      - "*.api.sub-{{ my_env }}.domain.cloud"

Works. But we need the extra wildcar domain...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants