mirror of
https://github.com/datarhei/core.git
synced 2025-10-04 07:37:33 +08:00
This commit is contained in:
@@ -649,7 +649,8 @@ func (a *api) start() error {
|
|||||||
|
|
||||||
var autocertManager *certmagic.Config
|
var autocertManager *certmagic.Config
|
||||||
|
|
||||||
if cfg.TLS.Enable && cfg.TLS.Auto {
|
if cfg.TLS.Enable {
|
||||||
|
if cfg.TLS.Auto {
|
||||||
if len(cfg.Host.Name) == 0 {
|
if len(cfg.Host.Name) == 0 {
|
||||||
return fmt.Errorf("at least one host must be provided in host.name or RS_HOST_NAME")
|
return fmt.Errorf("at least one host must be provided in host.name or RS_HOST_NAME")
|
||||||
}
|
}
|
||||||
@@ -742,6 +743,9 @@ func (a *api) start() error {
|
|||||||
cfg.TLS.CertFile = ""
|
cfg.TLS.CertFile = ""
|
||||||
cfg.TLS.KeyFile = ""
|
cfg.TLS.KeyFile = ""
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
a.log.logger.core.Info().Log("Enabling TLS with cert and key files")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.RTMP.Enable {
|
if cfg.RTMP.Enable {
|
||||||
@@ -756,14 +760,15 @@ func (a *api) start() error {
|
|||||||
Collector: a.sessions.Collector("rtmp"),
|
Collector: a.sessions.Collector("rtmp"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if autocertManager != nil && cfg.RTMP.EnableTLS {
|
if cfg.RTMP.EnableTLS {
|
||||||
config.TLSConfig = &tls.Config{
|
|
||||||
GetCertificate: autocertManager.GetCertificate,
|
|
||||||
}
|
|
||||||
|
|
||||||
config.Logger = config.Logger.WithComponent("RTMP/S")
|
config.Logger = config.Logger.WithComponent("RTMP/S")
|
||||||
|
|
||||||
a.log.logger.rtmps = a.log.logger.core.WithComponent("RTMPS").WithField("address", cfg.RTMP.AddressTLS)
|
a.log.logger.rtmps = a.log.logger.core.WithComponent("RTMPS").WithField("address", cfg.RTMP.AddressTLS)
|
||||||
|
if autocertManager != nil {
|
||||||
|
config.TLSConfig = &tls.Config{
|
||||||
|
GetCertificate: autocertManager.GetCertificate,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtmpserver, err := rtmp.New(config)
|
rtmpserver, err := rtmp.New(config)
|
||||||
|
Reference in New Issue
Block a user