Skip to content

Commit 0ae8f12

Browse files
authored
Fix missing TLS configuration check (#166)
1 parent 699d6a6 commit 0ae8f12

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

configs/rover_configs.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ core:
2828
# The TLS switch
2929
enable_TLS: ${ROVER_BACKEND_ENABLE_TLS:false}
3030
# The file path of client.pem. The config only works when opening the TLS switch.
31-
client_pem_path: ${ROVER_BACKEND_PEM_PATH:""}
31+
client_pem_path: ${ROVER_BACKEND_PEM_PATH:}
3232
# The file path of client.key. The config only works when opening the TLS switch.
33-
client_key_path: ${ROVER_BACKEND_KEY_PATH:""}
33+
client_key_path: ${ROVER_BACKEND_KEY_PATH:}
3434
# InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
3535
insecure_skip_verify: ${ROVER_BACKEND_INSECURE_SKIP_VERIFY:false}
3636
# The file path oca.pem. The config only works when opening the TLS switch.
37-
ca_pem_path: ${ROVER_BACKEND_CA_PEM_PATH:""}
37+
ca_pem_path: ${ROVER_BACKEND_CA_PEM_PATH:}
3838
# How frequently to check the connection(second)
3939
check_period: ${ROVER_BACKEND_CHECK_PERIOD:5}
4040
# The auth value when send request
41-
authentication: ${ROVER_BACKEND_AUTHENTICATION:""}
41+
authentication: ${ROVER_BACKEND_AUTHENTICATION:}
4242

4343
process_discovery:
4444
# The period of report or keep alive process(second)

pkg/core/backend/client.go

+3
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ func configTLS(conf *Config) (tc *tls.Config, tlsErr error) {
154154

155155
// checkTLSFile checks the TLS files.
156156
func checkTLSFile(path string) error {
157+
if path == "" {
158+
return nil
159+
}
157160
file, err := os.Open(path)
158161
if err != nil {
159162
return err

0 commit comments

Comments
 (0)