From 58bb65b83792d016df4df12dfc69b867fc8094e6 Mon Sep 17 00:00:00 2001 From: eryajf Date: Fri, 13 Sep 2024 22:29:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=90=8C=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E4=B8=8D=E9=80=9A=E8=B7=AF=E7=BA=BF=E7=9A=84=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E6=96=B9=E5=BC=8F=E8=8E=B7=E5=8F=96=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/export/cron_cache.go | 1 + pkg/export/record_cert.go | 5 +++-- pkg/provider/provider.go | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) 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"` }