aboutsummaryrefslogtreecommitdiff
path: root/weed/command/master.go
diff options
context:
space:
mode:
authorzuzuviewer <750938164@qq.com>2025-07-08 13:48:12 +0800
committerGitHub <noreply@github.com>2025-07-07 22:48:12 -0700
commit8fa1a69f8c915311326e75645681d10f66d9e222 (patch)
treec262e32f0764804cac5356fdadd1229a915f4649 /weed/command/master.go
parent39b7e44fb58d18bb3a1c118e878748a43f18757b (diff)
downloadseaweedfs-8fa1a69f8c915311326e75645681d10f66d9e222.tar.xz
seaweedfs-8fa1a69f8c915311326e75645681d10f66d9e222.zip
* Fix undefined http serve behaiver (#6943)
Diffstat (limited to 'weed/command/master.go')
-rw-r--r--weed/command/master.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/weed/command/master.go b/weed/command/master.go
index 6421d321d..8e10d25a2 100644
--- a/weed/command/master.go
+++ b/weed/command/master.go
@@ -2,6 +2,7 @@ package command
import (
"context"
+ "crypto/tls"
"fmt"
"net/http"
"os"
@@ -264,19 +265,20 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
clientCertFile = viper.GetString("https.master.ca")
}
- httpS := &http.Server{Handler: r}
if masterLocalListener != nil {
- go httpS.Serve(masterLocalListener)
+ go newHttpServer(r, nil).Serve(masterLocalListener)
}
+ var tlsConfig *tls.Config
if useMTLS {
- httpS.TLSConfig = security.LoadClientTLSHTTP(clientCertFile)
+ tlsConfig = security.LoadClientTLSHTTP(clientCertFile)
+ security.FixTlsConfig(util.GetViper(), tlsConfig)
}
if useTLS {
- go httpS.ServeTLS(masterListener, certFile, keyFile)
+ go newHttpServer(r, tlsConfig).ServeTLS(masterListener, certFile, keyFile)
} else {
- go httpS.Serve(masterListener)
+ go newHttpServer(r, nil).Serve(masterListener)
}
grace.OnInterrupt(ms.Shutdown)