You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2023/02/22 08:26:16 UTC

[dubbo-admin] branch refactor-with-go updated: Bugfix

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch refactor-with-go
in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git


The following commit(s) were added to refs/heads/refactor-with-go by this push:
     new 371ef47  Bugfix
371ef47 is described below

commit 371ef473b6808632324dbe2f33684eb81ba5d3e7
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Wed Feb 22 16:25:55 2023 +0800

    Bugfix
---
 ca/cmd/main.go            | 2 +-
 ca/pkg/cert/util.go       | 2 +-
 ca/pkg/security/server.go | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ca/cmd/main.go b/ca/cmd/main.go
index ece7146..78d23b0 100644
--- a/ca/cmd/main.go
+++ b/ca/cmd/main.go
@@ -27,7 +27,7 @@ const namespace = "dubbo-system"
 func main() {
 	// TODO read options from env
 	options := &config.Options{
-		EnableKubernetes: true,
+		EnableKubernetes: false,
 		Namespace:        namespace,
 		PlainServerPort:  30060,
 		SecureServerPort: 30062,
diff --git a/ca/pkg/cert/util.go b/ca/pkg/cert/util.go
index 0f286d1..5fdfbe2 100644
--- a/ca/pkg/cert/util.go
+++ b/ca/pkg/cert/util.go
@@ -168,7 +168,7 @@ func SignFromCSR(csr *x509.CertificateRequest, authorityCert *Cert, certValidity
 		NotBefore:    time.Now(),
 		NotAfter:     time.Now().Add(time.Duration(certValidity) * time.Millisecond),
 		KeyUsage:     x509.KeyUsageDigitalSignature,
-		ExtKeyUsage:  []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth | x509.ExtKeyUsageServerAuth},
+		ExtKeyUsage:  []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
 	}
 	csrTemplate.DNSNames = csr.DNSNames
 
diff --git a/ca/pkg/security/server.go b/ca/pkg/security/server.go
index b1efdc9..531d574 100644
--- a/ca/pkg/security/server.go
+++ b/ca/pkg/security/server.go
@@ -126,7 +126,7 @@ func (s *Server) ScheduleRefreshAuthorityCert() {
 }
 
 func (s *Server) RefreshAuthorityCert() {
-	if !s.CertStorage.AuthorityCert.IsValid() {
+	if s.CertStorage.AuthorityCert.IsValid() {
 		log.Printf("Load authority cert from kubernetes secrect success.")
 	} else {
 		log.Printf("Load authority cert from kubernetes secrect failed.")