@@ -176,6 +176,7 @@ func (d *Config) init() {
176176 d .val (newAddressValue (& d .TLS .Address , ":8181" ), "tls.address" , "CORE_TLS_ADDRESS" , nil , "HTTPS listening address" , false , false )
177177 d .val (newBoolValue (& d .TLS .Enable , false ), "tls.enable" , "CORE_TLS_ENABLE" , nil , "Enable HTTPS" , false , false )
178178 d .val (newBoolValue (& d .TLS .Auto , false ), "tls.auto" , "CORE_TLS_AUTO" , nil , "Enable Let's Encrypt certificate" , false , false )
179+ d .
val (
newEmailValue (
& d .
TLS .
Email ,
"[email protected] " ),
"tls.email" ,
"CORE_TLS_EMAIL" ,
nil ,
"Email for Let's Encrypt registration" ,
false ,
false )
179180 d .val (newFileValue (& d .TLS .CertFile , "" ), "tls.cert_file" , "CORE_TLS_CERTFILE" , nil , "Path to certificate file in PEM format" , false , false )
180181 d .val (newFileValue (& d .TLS .KeyFile , "" ), "tls.key_file" , "CORE_TLS_KEYFILE" , nil , "Path to key file in PEM format" , false , false )
181182
@@ -419,6 +420,14 @@ func (d *Config) Validate(resetLogs bool) {
419420 }
420421 }
421422
423+ // If TLS and Let's Encrypt certificate is enabled, we require a non-empty email address
424+ if d .TLS .Enable && d .TLS .Auto {
425+ if len (d .TLS .Email ) == 0 {
426+ v := d .findVariable ("tls.email" )
427+ v .value .Set (v .defVal )
428+ }
429+ }
430+
422431 // If TLS for RTMP is enabled, TLS must be enabled
423432 if d .RTMP .EnableTLS {
424433 if ! d .RTMP .Enable {
0 commit comments