Skip to content

Commit cc86b22

Browse files
committed
Launcher fix: if CA cert cannot be added don't continue
1 parent ae2f726 commit cc86b22

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

launcher/internal/cmdUtils/cert.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func (c *Config) AddCert(gameId string, serverId uuid.UUID, serverCertificate *x
9898
certMsg += "..."
9999
logger.Println(certMsg)
100100
var err error
101+
var setupErr error
101102
if err = commonLogger.FileLogger.Buffer("config_setup_CA_store", func(writer io.Writer) {
102103
if result := executor.RunSetUp(gameId, nil, addUserCertData, addLocalCertData, nil, false, false, false, "", c.certFilePath, "", writer, func(options exec.Options) {
103104
commonLogger.Println("run config setup for CA store cert", options.String())
@@ -110,15 +111,19 @@ func (c *Config) AddCert(gameId string, serverId uuid.UUID, serverCertificate *x
110111
errorCode = internal.ErrConfigCertAdd
111112
if result.Err != nil {
112113
logger.Println("Error message: " + result.Err.Error())
114+
setupErr = result.Err
113115
}
114116
if result.ExitCode != common.ErrSuccess {
115117
logger.Printf(`Exit code: %d.`+"\n", result.ExitCode)
118+
setupErr = fmt.Errorf("exit code: %d", result.ExitCode)
116119
}
117-
return
118120
}
119121
}); err != nil {
120122
return common.ErrFileLog
121123
}
124+
if setupErr != nil {
125+
return internal.ErrConfigCertAdd
126+
}
122127
if !customCertFile {
123128
for _, host := range hosts {
124129
if !server.CheckConnectionFromServer(host, false, nil) {

0 commit comments

Comments
 (0)