mirror of
https://github.com/datarhei/core.git
synced 2025-10-01 06:12:26 +08:00
This commit is contained in:
@@ -649,7 +649,8 @@ func (a *api) start() error {
|
||||
|
||||
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 {
|
||||
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.KeyFile = ""
|
||||
}
|
||||
} else {
|
||||
a.log.logger.core.Info().Log("Enabling TLS with cert and key files")
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.RTMP.Enable {
|
||||
@@ -756,14 +760,15 @@ func (a *api) start() error {
|
||||
Collector: a.sessions.Collector("rtmp"),
|
||||
}
|
||||
|
||||
if autocertManager != nil && cfg.RTMP.EnableTLS {
|
||||
config.TLSConfig = &tls.Config{
|
||||
GetCertificate: autocertManager.GetCertificate,
|
||||
}
|
||||
|
||||
if cfg.RTMP.EnableTLS {
|
||||
config.Logger = config.Logger.WithComponent("RTMP/S")
|
||||
|
||||
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)
|
||||
|
Reference in New Issue
Block a user