diff --git a/pkg/export/cron_cache.go b/pkg/export/cron_cache.go index 2125a80..3582348 100644 --- a/pkg/export/cron_cache.go +++ b/pkg/export/cron_cache.go @@ -105,6 +105,7 @@ func loadingCert() { CloudName: v.CloudName, DomainName: v.DomainName, FullRecord: v.FullRecord, + RecordValue: v.RecordValue, RecordID: v.RecordID, }) } diff --git a/pkg/export/record_cert.go b/pkg/export/record_cert.go index f02d6ce..4e118d8 100644 --- a/pkg/export/record_cert.go +++ b/pkg/export/record_cert.go @@ -69,11 +69,12 @@ func GetMultipleCertInfo(records []provider.GetRecordCertReq) ([]provider.Record func GetCertInfo(record provider.GetRecordCertReq) (certInfo provider.RecordCert, err error) { config := &tls.Config{ InsecureSkipVerify: true, + ServerName: record.FullRecord, } d := net.Dialer{ Timeout: time.Second * 3, } - conn, err := tls.DialWithDialer(&d, "tcp", record.FullRecord+":443", config) + conn, err := tls.DialWithDialer(&d, "tcp", record.RecordValue+":443", config) if err != nil { return certInfo, err } @@ -135,7 +136,7 @@ func getNewRecord(records []provider.Record) (newRecords []provider.Record) { rec.FullRecord = strings.ReplaceAll(rec.FullRecord, "*", "a") } if (rec.RecordType == "A" || rec.RecordType == "CNAME") && - rec.RecordStatus == "enable" && isPortOpen(rec.FullRecord) { + rec.RecordStatus == "enable" && isPortOpen(rec.RecordValue) { recordChan <- rec } }(record) diff --git a/pkg/provider/provider.go b/pkg/provider/provider.go index 5ff8912..1681779 100644 --- a/pkg/provider/provider.go +++ b/pkg/provider/provider.go @@ -109,6 +109,7 @@ type GetRecordCertReq struct { CloudName string `json:"cloud_name"` DomainName string `json:"domain_name"` FullRecord string `json:"full_record"` + RecordValue string `json:"record_value"` RecordID string `json:"record_id"` }