-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from HyNetwork/wip-acme
ACME implementation
- Loading branch information
Showing
7 changed files
with
164 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package main | ||
|
||
import ( | ||
"crypto/tls" | ||
"github.com/caddyserver/certmagic" | ||
) | ||
|
||
func acmeTLSConfig(domains []string, email string, disableHTTP bool, disableTLSALPN bool, | ||
altHTTPPort int, altTLSALPNPort int) (*tls.Config, error) { | ||
certmagic.DefaultACME.Agreed = true | ||
certmagic.DefaultACME.Email = email | ||
certmagic.DefaultACME.DisableHTTPChallenge = disableHTTP | ||
certmagic.DefaultACME.DisableTLSALPNChallenge = disableTLSALPN | ||
certmagic.DefaultACME.AltHTTPPort = altHTTPPort | ||
certmagic.DefaultACME.AltTLSALPNPort = altTLSALPNPort | ||
cfg := certmagic.NewDefault() | ||
return cfg.TLSConfig(), cfg.ManageSync(domains) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.