This is an automated email from the ASF dual-hosted git repository.

liuhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/main by this push:
     new 0ae8f12  Fix missing TLS configuration check (#166)
0ae8f12 is described below

commit 0ae8f12d6eb6cc9fa125c603ee57d0b21fc8c6d0
Author: mrproliu <[email protected]>
AuthorDate: Tue Dec 10 11:09:14 2024 +0900

    Fix missing TLS configuration check (#166)
---
 configs/rover_configs.yaml | 8 ++++----
 pkg/core/backend/client.go | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/configs/rover_configs.yaml b/configs/rover_configs.yaml
index f86ef0a..ce39111 100644
--- a/configs/rover_configs.yaml
+++ b/configs/rover_configs.yaml
@@ -28,17 +28,17 @@ core:
     # The TLS switch
     enable_TLS: ${ROVER_BACKEND_ENABLE_TLS:false}
     # The file path of client.pem. The config only works when opening the TLS 
switch.
-    client_pem_path: ${ROVER_BACKEND_PEM_PATH:""}
+    client_pem_path: ${ROVER_BACKEND_PEM_PATH:}
     # The file path of client.key. The config only works when opening the TLS 
switch.
-    client_key_path: ${ROVER_BACKEND_KEY_PATH:""}
+    client_key_path: ${ROVER_BACKEND_KEY_PATH:}
     # InsecureSkipVerify controls whether a client verifies the server's 
certificate chain and host name.
     insecure_skip_verify: ${ROVER_BACKEND_INSECURE_SKIP_VERIFY:false}
     # The file path oca.pem. The config only works when opening the TLS switch.
-    ca_pem_path: ${ROVER_BACKEND_CA_PEM_PATH:""}
+    ca_pem_path: ${ROVER_BACKEND_CA_PEM_PATH:}
     # How frequently to check the connection(second)
     check_period: ${ROVER_BACKEND_CHECK_PERIOD:5}
     # The auth value when send request
-    authentication: ${ROVER_BACKEND_AUTHENTICATION:""}
+    authentication: ${ROVER_BACKEND_AUTHENTICATION:}
 
 process_discovery:
   # The period of report or keep alive process(second)
diff --git a/pkg/core/backend/client.go b/pkg/core/backend/client.go
index 10284d7..2e1e8b9 100644
--- a/pkg/core/backend/client.go
+++ b/pkg/core/backend/client.go
@@ -154,6 +154,9 @@ func configTLS(conf *Config) (tc *tls.Config, tlsErr error) 
{
 
 // checkTLSFile checks the TLS files.
 func checkTLSFile(path string) error {
+       if path == "" {
+               return nil
+       }
        file, err := os.Open(path)
        if err != nil {
                return err

Reply via email to