mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
add self CertMode
This commit is contained in:
41
node/lego_test.go
Normal file
41
node/lego_test.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/InazumaV/V2bX/conf"
|
||||
)
|
||||
|
||||
var l *Lego
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
l, err = NewLego(&conf.CertConfig{
|
||||
CertMode: "dns",
|
||||
Email: "test@test.com",
|
||||
CertDomain: "test.test.com",
|
||||
Provider: "cloudflare",
|
||||
DNSEnv: map[string]string{
|
||||
"CF_DNS_API_TOKEN": "123",
|
||||
},
|
||||
CertFile: "./cert/1.pem",
|
||||
KeyFile: "./cert/1.key",
|
||||
})
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLego_CreateCertByDns(t *testing.T) {
|
||||
err := l.CreateCert()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLego_RenewCert(t *testing.T) {
|
||||
log.Println(l.RenewCert())
|
||||
}
|
||||
Reference in New Issue
Block a user