2019-10-11 18:25:15 +03:00
|
|
|
package certmagic
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/go-acme/lego/v3/providers/dns/cloudflare"
|
2019-10-11 18:47:05 +03:00
|
|
|
// "github.com/micro/go-micro/api/server/acme"
|
2019-10-11 18:25:15 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCertMagic(t *testing.T) {
|
2019-10-11 18:47:05 +03:00
|
|
|
// TODO: Travis doesn't let us bind :443
|
|
|
|
// l, err := New().NewListener()
|
|
|
|
// if err != nil {
|
|
|
|
// t.Error(err.Error())
|
|
|
|
// }
|
|
|
|
// l.Close()
|
2019-10-11 18:25:15 +03:00
|
|
|
|
|
|
|
c := cloudflare.NewDefaultConfig()
|
|
|
|
c.AuthEmail = ""
|
|
|
|
c.AuthKey = ""
|
|
|
|
c.AuthToken = "test"
|
|
|
|
c.ZoneToken = "test"
|
|
|
|
|
2019-10-11 18:47:05 +03:00
|
|
|
_, err := cloudflare.NewDNSProviderConfig(c)
|
2019-10-11 18:25:15 +03:00
|
|
|
if err != nil {
|
|
|
|
t.Error(err.Error())
|
|
|
|
}
|
|
|
|
|
2019-10-11 18:47:05 +03:00
|
|
|
// TODO: Travis doesn't let us bind :443
|
|
|
|
// l, err = New(acme.AcceptTLS(true),
|
|
|
|
// acme.CA(acme.LetsEncryptStagingCA),
|
|
|
|
// acme.ChallengeProvider(p),
|
|
|
|
// ).NewListener()
|
2019-10-11 18:25:15 +03:00
|
|
|
|
2019-10-11 18:47:05 +03:00
|
|
|
// if err != nil {
|
|
|
|
// t.Error(err.Error())
|
|
|
|
// }
|
|
|
|
// l.Close()
|
2019-10-11 18:25:15 +03:00
|
|
|
}
|