Fail when TLS is configured and HTTP endpoints are provided (#5771)

This commit is contained in:
Harshavardhana
2018-04-09 19:10:23 -07:00
committed by Nitish Tiwari
parent a706c21f70
commit eb0deabd73
2 changed files with 11 additions and 5 deletions

View File

@@ -210,8 +210,13 @@ func serverMain(ctx *cli.Context) {
logger.FatalIf(err, "Invalid SSL certificate file")
// Is distributed setup, error out if no certificates are found for HTTPS endpoints.
if globalIsDistXL && globalEndpoints.IsHTTPS() && !globalIsSSL {
logger.FatalIf(errInvalidArgument, "No certificates found for HTTPS endpoints (%s)", globalEndpoints)
if globalIsDistXL {
if globalEndpoints.IsHTTPS() && !globalIsSSL {
logger.FatalIf(errInvalidArgument, "No certificates found, use HTTP endpoints (%s)", globalEndpoints)
}
if !globalEndpoints.IsHTTPS() && globalIsSSL {
logger.FatalIf(errInvalidArgument, "TLS Certificates found, use HTTPS endpoints (%s)", globalEndpoints)
}
}
if !quietFlag {