This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-satellite.git
The following commit(s) were added to refs/heads/main by this push:
new a19ea3d Fix the gRPC server enable TLS failure (#93)
a19ea3d is described below
commit a19ea3d6bc0c40cc06f3cc5083db44c47012cec3
Author: mrproliu <[email protected]>
AuthorDate: Wed Dec 8 12:44:29 2021 +0800
Fix the gRPC server enable TLS failure (#93)
---
CHANGES.md | 1 +
configs/satellite_config.yaml | 2 +-
docs/en/setup/examples/deploy/linux-windows/README.md | 10 ----------
.../feature/transmit-log-to-kafka/satellite_config.yaml | 2 +-
plugins/server/grpc/server.go | 2 +-
5 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 14e1d57..33e9e19 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -8,6 +8,7 @@ Release Notes.
* Make the gRPC client `client_pem_path` and `client_key_path` as an optional
config.
#### Bug Fixes
+* Fix the gRPC server enable TLS failure.
#### Issues and PR
- All issues are
[here](https://github.com/apache/skywalking/milestone/113?closed=1)
diff --git a/configs/satellite_config.yaml b/configs/satellite_config.yaml
index 4ac809b..d46b235 100644
--- a/configs/satellite_config.yaml
+++ b/configs/satellite_config.yaml
@@ -105,7 +105,7 @@ sharing:
# The address of grpc server.
address: ${SATELLITE_GRPC_ADDRESS:":11800"}
# The TLS cert file path.
- tls_cert_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
+ tls_cert_file: ${SATELLITE_GRPC_TLS_CERT_FILE:""}
# The TLS key file path.
tls_key_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
- plugin_name: "prometheus-server"
diff --git a/docs/en/setup/examples/deploy/linux-windows/README.md
b/docs/en/setup/examples/deploy/linux-windows/README.md
index 691cf35..f75a26a 100644
--- a/docs/en/setup/examples/deploy/linux-windows/README.md
+++ b/docs/en/setup/examples/deploy/linux-windows/README.md
@@ -42,11 +42,6 @@ sharing:
check_period: ${SATELLITE_GRPC_CHECK_PERIOD:5}
# The auth value when send request
authentication: ${SATELLITE_GRPC_AUTHENTICATION:""}
- address: ${SATELLITE_GRPC_ADDRESS:":11800"}
- # The TLS cert file path.
- tls_cert_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
- # The TLS key file path.
- tls_key_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
```
#### Kubernetes selector
@@ -88,11 +83,6 @@ sharing:
check_period: ${SATELLITE_GRPC_CHECK_PERIOD:5}
# The auth value when send request
authentication: ${SATELLITE_GRPC_AUTHENTICATION:""}
- address: ${SATELLITE_GRPC_ADDRESS:":11800"}
- # The TLS cert file path.
- tls_cert_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
- # The TLS key file path.
- tls_key_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
```
### Start Satellite
diff --git
a/docs/en/setup/examples/feature/transmit-log-to-kafka/satellite_config.yaml
b/docs/en/setup/examples/feature/transmit-log-to-kafka/satellite_config.yaml
index b79e614..1498c46 100644
--- a/docs/en/setup/examples/feature/transmit-log-to-kafka/satellite_config.yaml
+++ b/docs/en/setup/examples/feature/transmit-log-to-kafka/satellite_config.yaml
@@ -54,7 +54,7 @@ sharing:
# The address of grpc server.
address: ${SATELLITE_GRPC_ADDRESS:":11800"}
# The TLS cert file path.
- tls_cert_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
+ tls_cert_file: ${SATELLITE_GRPC_TLS_CERT_FILE:""}
# The TLS key file path.
tls_key_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
- plugin_name: "prometheus-server"
diff --git a/plugins/server/grpc/server.go b/plugins/server/grpc/server.go
index a3f9f17..8c1cca3 100644
--- a/plugins/server/grpc/server.go
+++ b/plugins/server/grpc/server.go
@@ -77,7 +77,7 @@ tls_key_file: ""
func (s *Server) Prepare() error {
var options []grpc.ServerOption
if s.TLSCertFile != "" && s.TLSKeyFile != "" {
- if c, err := credentials.NewClientTLSFromFile(s.TLSCertFile,
s.TLSKeyFile); err == nil {
+ if c, err := credentials.NewServerTLSFromFile(s.TLSCertFile,
s.TLSKeyFile); err == nil {
options = append(options, grpc.Creds(c))
} else {
log.Logger.Errorf("error in checking TLS files: %v",
err)