mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
42 lines
629 B
Go
42 lines
629 B
Go
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())
|
|
}
|