Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes ACME default configuration #5839

Merged
merged 1 commit into from
Mar 5, 2021
Merged

Fixes ACME default configuration #5839

merged 1 commit into from
Mar 5, 2021

Conversation

klizhentas
Copy link
Contributor

Fixes #5771, tctl configure has to generate port :443
when ACME is on, because TLS-ALPN-01 challenge only works on 443 port.

@klizhentas
Copy link
Contributor Author

@russjones @r0mant can you folks please review
@benarent can you give it a run too?

Fixes #5771, tctl configure has to generate port :443
when ACME is on, because TLS-ALPN-01 challenge only works on 443 port.
@benarent
Copy link
Contributor

benarent commented Mar 4, 2021

I just tried this on a new cluster and it worked using the below, the one unrelated issue would be to change how we setup configure. I have a note below.

$ sudo teleport configure --cluster-name=silver.asteroid.earth --acme --acme-email=ben@goteleport.com -o file
Wrote config to file "/etc/teleport.yaml". Now you can start the server. Happy Teleporting!
teleport:
  nodename: ip-172-31-13-209
  data_dir: /var/lib/teleport
  log:
    output: stderr
    severity: INFO
  ca_pin: ""
auth_service:
  enabled: "yes"
  listen_addr: 0.0.0.0:3025
  cluster_name: silver.asteroid.earth
ssh_service:
  enabled: "yes"
  labels:
    env: example
  commands:
  - name: hostname
    command: [hostname]
    period: 1m0s
proxy_service:
  enabled: "yes"
  listen_addr: 0.0.0.0:3023
  web_listen_addr: :443
  public_addr: silver.asteroid.earth:443
  https_keypairs: []
  acme:
    enabled: "yes"
    email: ben@goteleport.com

When using the new script, I've noticed that the TLS certificate adds the node name into the cert. I've found that setting a public_addr is better as an IP/FQDN is needed for plugins to work.

INFO [CA]        Generating TLS certificate {0x431d270 0xc000294180 1.3.9999.1.7=#131573696c7665722e61737465726f69642e6561727468,CN=eb704764-01dc-416c-8c8a-542de3c7abf1.silver.asteroid.earth,O=Admin,POSTALCODE=null,STREET= 2031-03-02 21:30:30.573250614 +0000 UTC [ip-172-31-13-209 *.teleport.cluster.local teleport.cluster.local]}. common_name:eb704764-01dc-416c-8c8a-542de3c7abf1.silver.asteroid.earth dns_names:[ip-172-31-13-209 *.teleport.cluster.local teleport.cluster.local] locality:[] not_after:2031-03-02 21:30:30.573250614 +0000 UTC org:[Admin] org_unit:[] tlsca/ca.go:562

Comment on lines +385 to +386
p.PublicAddr = utils.Strings{net.JoinHostPort(flags.ClusterName, fmt.Sprintf("%d", teleport.StandardHTTPSPort))}
p.WebAddr = fmt.Sprintf(":%d", teleport.StandardHTTPSPort)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use strconv.Itoa here like the following:

p.PublicAddr = utils.Strings{net.JoinHostPort(flags.ClusterName, strconv.Itoa(teleport.StandardHTTPSPort))}
p.WebAddr = net.JoinHostPort("", strconv.Itoa(teleport.StandardHTTPSPort))

@klizhentas
Copy link
Contributor Author

@benarent not sure I follow, can you please elaborate on the IP/FQDN?

@benarent
Copy link
Contributor

benarent commented Mar 5, 2021

not sure I follow, can you please elaborate on the IP/FQDN?

^ I'm going to create another ticket that outlines this issue.

@klizhentas klizhentas merged commit f134ab8 into branch/v6 Mar 5, 2021
klizhentas added a commit that referenced this pull request Mar 5, 2021
Fixes #5771, tctl configure has to generate port :443
when ACME is on, because TLS-ALPN-01 challenge only works on 443 port.
russjones pushed a commit that referenced this pull request Mar 6, 2021
Fixes #5771, tctl configure has to generate port :443
when ACME is on, because TLS-ALPN-01 challenge only works on 443 port.
klizhentas added a commit that referenced this pull request Mar 6, 2021
Fixes #5771, tctl configure has to generate port :443
when ACME is on, because TLS-ALPN-01 challenge only works on 443 port.
klizhentas added a commit that referenced this pull request Mar 6, 2021
Fixes #5771, tctl configure has to generate port :443
when ACME is on, because TLS-ALPN-01 challenge only works on 443 port.
@klizhentas klizhentas deleted the sasha/acmectl branch March 15, 2021 16:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants