完成初始化证书事务和远程部署互斥并纳入发布构建脚本
This commit is contained in:
1 parent
05e05a1a23
commit
a4dffb04d4
27 files changed
+1294
-25
No files matched your search
@@ -2,6 +2,7 @@ package certificate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
@@ -55,6 +56,7 @@ type Service struct {
|
||||
store FileStore
|
||||
newIssuer IssuerFactory
|
||||
preferredChain string
|
||||
acmeRoots *x509.CertPool
|
||||
}
|
||||
|
||||
func (s *Service) SetDNSAuthorizationChecker(checker DNSAuthorizationChecker) {
|
||||
@@ -181,7 +183,7 @@ func (s *Service) Issue(ctx context.Context, domainID string) (IssueResult, erro
|
||||
if err != nil {
|
||||
return fail(err)
|
||||
}
|
||||
if err := validateIssuedResource(ctx, resource, domains); err != nil {
|
||||
if err := s.validateACMEResource(ctx, resource, domains, item.ACMEEnvironment); err != nil {
|
||||
return fail(err)
|
||||
}
|
||||
saved, err := s.store.SaveForType(ctx, item.Name, string(item.CertificateType), resource)
|
||||
@@ -258,7 +260,7 @@ func (s *Service) IssueForSetup(ctx context.Context, request SetupCertificateReq
|
||||
if err != nil {
|
||||
return SavedResource{}, fmt.Errorf("初始化证书校验失败:%w", err)
|
||||
}
|
||||
if err := validateIssuedResource(ctx, resource, domains); err != nil {
|
||||
if err := s.validateACMEResource(ctx, resource, domains, environment); err != nil {
|
||||
return SavedResource{}, err
|
||||
}
|
||||
store := FileStore{Root: request.CertificateRoot, BackupRoot: request.BackupRoot}
|
||||
|
||||
Reference in new issue
Block a user