mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
feat: support not-only Let's Encrypt service #16
This commit is contained in:
parent
3e90b838fd
commit
49b41d6eb7
6 changed files with 60 additions and 57 deletions
|
@ -5,9 +5,11 @@ import (
|
|||
"crypto/ecdsa"
|
||||
"crypto/elliptic"
|
||||
"crypto/rand"
|
||||
"crypto/tls"
|
||||
"github.com/go-acme/lego/v4/lego"
|
||||
"github.com/go-acme/lego/v4/registration"
|
||||
"math/big"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type PrivateKey struct {
|
||||
|
@ -55,6 +57,16 @@ func (u *AcmeUser) Register() error {
|
|||
}
|
||||
|
||||
config := lego.NewConfig(u)
|
||||
config.CADirURL = u.CADir
|
||||
u.Registration = registration.Resource{}
|
||||
|
||||
// Skip TLS check
|
||||
if config.HTTPClient != nil {
|
||||
config.HTTPClient.Transport = &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
}
|
||||
|
||||
client, err := lego.NewClient(config)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue