mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(scheduler,monitor): tls 3des (#22335)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user