fix(scheduler,monitor): tls 3des (#22335)

This commit is contained in:
Zexi Li
2025-03-25 21:15:03 +08:00
committed by GitHub
parent aa12abead1
commit 63be6ae064
2 changed files with 9 additions and 10 deletions
+4 -2
View File
@@ -107,10 +107,12 @@ func InitInfluxDBSubscriptionHandlers(app *appsrv.Application, options *common_o
addr := net.JoinHostPort(options.Address, strconv.Itoa(options.Port))
if options.EnableSsl {
err := http.ListenAndServeTLS(addr,
srv := appsrv.InitHTTPServer(app, addr)
srv.Handler = root
err := srv.ListenAndServeTLS(
options.SslCertfile,
options.SslKeyfile,
root)
)
if err != nil && err != http.ErrServerClosed {
log.Fatalf("%v", err)
}
+5 -8
View File
@@ -18,7 +18,6 @@ import (
"context"
"io/ioutil"
"net"
"net/http"
"strconv"
"time"
@@ -106,7 +105,7 @@ func StartService() error {
o.Options.EnableDBChecksumTables = false
o.Options.DBChecksumSkipInit = true
return StartServiceWrapper(&dbOpts, commonOpts, func(_ *appsrv.Application) error {
return StartServiceWrapper(&dbOpts, commonOpts, func(app *appsrv.Application) error {
common_options.StartOptionManager(&o.Options, o.Options.ConfigSyncPeriodSeconds, compute_api.SERVICE_TYPE, compute_api.SERVICE_VERSION, o.OnOptionsChange)
// gin http framework mode configuration
@@ -140,11 +139,11 @@ func StartService() error {
}
startSched()
//InitHandlers(app)
return startHTTP(&o.Options)
return startHTTP(app, &o.Options)
})
}
func startHTTP(opt *o.SchedulerOptions) error {
func startHTTP(app *appsrv.Application, opt *o.SchedulerOptions) error {
gin.DefaultWriter = ioutil.Discard
router := gin.Default()
@@ -155,10 +154,8 @@ func startHTTP(opt *o.SchedulerOptions) error {
prometheus.InstallHandler(router)
schedhandler.InstallHandler(router)
server := &http.Server{
Addr: net.JoinHostPort(opt.Address, strconv.Itoa(int(opt.Port))),
Handler: router,
}
server := appsrv.InitHTTPServer(app, net.JoinHostPort(opt.Address, strconv.Itoa(int(opt.Port))))
server.Handler = router
log.Infof("Start server on: %s:%d", opt.Address, opt.Port)