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

Traefik still start when Let's encrypt is down #2794

Merged
merged 5 commits into from
Feb 5, 2018
Merged

Conversation

juliens
Copy link
Member

@juliens juliens commented Feb 2, 2018

What does this PR do?

Fix traefik crash when Let's Encrypt is down

Motivation

Be able to start traefik even if LE is down.
Fixes #791

More

The already generated certificates are still used.
If Traefik starts with LE down, you will need to restart Traefik in order to reconnect to LE and onHostRule certificates will generate error logs
In order to have this fix in 1.5.2 we don't change ACME too deeply, more deeply changes may come in 1.6.

  • Added/updated tests
  • Added/updated documentation

@@ -144,6 +144,11 @@ entryPoint = "https"
If `HTTP-01` challenge is used, `acme.httpChallenge.entryPoint` has to be defined and reachable by Let's Encrypt through the port 80.
These are Let's Encrypt limitations as described on the [community forum](https://community.letsencrypt.org/t/support-for-ports-other-than-80-and-443/3419/72).

!!! note
If Let's Encrypt is down when Træfik is started, already generated certificates will be used, but certificates will not be renewed, and no new certificate will be generated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify this paragraph.

Copy link
Contributor

@dtomcej dtomcej Feb 2, 2018

Choose a reason for hiding this comment

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

If LetsEncrypt is unavailable when Træfik is started, previously generated certificates will be usable, but expired certificates will not be renewed, and new certificates will not be be generated. Træfik will need to be restarted when LetsEncrypt is available to re-enable certificate generation and renewal.

acme/acme.go Outdated
@@ -333,7 +334,8 @@ func (a *ACME) CreateLocalConfig(tlsConfig *tls.Config, certs *safe.Safe, checkO

a.client, err = a.buildACMEClient(account)
if err != nil {
return err
log.Errorf("Failed to build ACME Client: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make this message more verbose?
"Failed to build ACME client" doesn't really tell a whole lot. Would make this message more like:
"Failed to build ACME client. LetsEncrypt functionality will be limited until traefik is restarted."

@@ -144,6 +144,11 @@ entryPoint = "https"
If `HTTP-01` challenge is used, `acme.httpChallenge.entryPoint` has to be defined and reachable by Let's Encrypt through the port 80.
These are Let's Encrypt limitations as described on the [community forum](https://community.letsencrypt.org/t/support-for-ports-other-than-80-and-443/3419/72).

!!! note
If Let's Encrypt is down when Træfik is started, already generated certificates will be used, but certificates will not be renewed, and no new certificate will be generated.
Copy link
Contributor

@dtomcej dtomcej Feb 2, 2018

Choose a reason for hiding this comment

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

If LetsEncrypt is unavailable when Træfik is started, previously generated certificates will be usable, but expired certificates will not be renewed, and new certificates will not be be generated. Træfik will need to be restarted when LetsEncrypt is available to re-enable certificate generation and renewal.

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM


If Let's Encrypt is not reachable, these certificates will be used :
- ACME certificates already generated before downtime,
Copy link
Member

Choose a reason for hiding this comment

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

Could you please remove ,


If Let's Encrypt is not reachable, these certificates will be used :
- ACME certificates already generated before downtime,
- Expired ACME certificates,
Copy link
Member

Choose a reason for hiding this comment

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

Could you please remove ,

If Let's Encrypt is not reachable, these certificates will be used :
- ACME certificates already generated before downtime,
- Expired ACME certificates,
- Provided certificates,
Copy link
Member

Choose a reason for hiding this comment

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

Could you please remove ,

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

5 participants