Skip to content

Commit a281ae3

Browse files
committed
SPP_DISABLE_JWT/SPP_DISABLE_TLS
1 parent adf841f commit a281ae3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Add `spp-probe.yml` to working directory (or set `SPP_PROBE_CONFIG_FILE` env):
2626
```yml
2727
spp:
2828
platform_host: "localhost"
29-
disable_tls: true
29+
ssl_enabled: false
3030
skywalking:
3131
collector:
3232
backend_service: "localhost:11800"
@@ -38,7 +38,7 @@ Or construct with dict:
3838
from sourceplusplus.SourcePlusPlus import SourcePlusPlus
3939
SourcePlusPlus({
4040
"spp.platform_host": "localhost",
41-
"spp.disable_tls": True,
41+
"spp.ssl_enabled": False,
4242
"skywalking.collector.backend_service": "localhost:11800"
4343
}).attach()
4444
```

sourceplusplus/SourcePlusPlus.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def __init__(self, args: dict = None):
5656
probe_config["spp"]["verify_host"] = str(self.get_config_value(
5757
"SPP_TLS_VERIFY_HOST", probe_config["spp"].get("verify_host"), True
5858
)).lower() == "true"
59-
probe_config["spp"]["disable_tls"] = str(self.get_config_value(
60-
"SPP_DISABLE_TLS", probe_config["spp"].get("disable_tls"), False
59+
probe_config["spp"]["ssl_enabled"] = str(self.get_config_value(
60+
"SPP_HTTP_SSL_ENABLED", probe_config["spp"].get("ssl_enabled"), True
6161
)).lower() == "true"
6262
probe_config["skywalking"]["agent"]["service_name"] = self.get_config_value(
6363
"SPP_SERVICE_NAME", probe_config["skywalking"]["agent"].get("service_name"), "spp"
@@ -90,21 +90,21 @@ def attach(self):
9090
collector_address=self.probe_config["skywalking"]["collector"]["backend_service"],
9191
service_name=self.probe_config["skywalking"]["agent"]["service_name"],
9292
log_reporter_active=True,
93-
force_tls=self.probe_config["spp"]["disable_tls"] is False,
93+
force_tls=self.probe_config["spp"]["ssl_enabled"] is True,
9494
log_reporter_formatted=False
9595
)
9696
agent.start()
9797

9898
ca_data = None
99-
if self.probe_config["spp"]["disable_tls"] is False \
99+
if self.probe_config["spp"]["ssl_enabled"] is True \
100100
and self.probe_config["spp"].get("probe_certificate") is not None:
101101
ca_data = "-----BEGIN CERTIFICATE-----\n" + \
102102
self.probe_config["spp"]["probe_certificate"] + \
103103
"\n-----END CERTIFICATE-----"
104104

105105
ssl_ctx = ssl.create_default_context(cadata=ca_data)
106106
ssl_ctx.check_hostname = self.probe_config["spp"]["verify_host"]
107-
if self.probe_config["spp"]["disable_tls"] is True:
107+
if self.probe_config["spp"]["ssl_enabled"] is False:
108108
ssl_ctx = None
109109
elif ssl_ctx.check_hostname is True:
110110
ssl_ctx.verify_mode = ssl.CERT_REQUIRED

0 commit comments

Comments
 (0)