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

tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new a85de20  Fix bug: the tlsConfig used wrong (#610)
a85de20 is described below

commit a85de206b075033df408bd2d599b32d811dab315
Author: victor chan <[email protected]>
AuthorDate: Wed Dec 18 16:17:54 2019 +0800

    Fix bug: the tlsConfig used wrong (#610)
---
 syncer/config/tlsconfig.go | 4 ++--
 syncer/server/handler.go   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/syncer/config/tlsconfig.go b/syncer/config/tlsconfig.go
index a2e7445..9f0ce4d 100644
--- a/syncer/config/tlsconfig.go
+++ b/syncer/config/tlsconfig.go
@@ -159,8 +159,8 @@ func (t *TLSConfig) ServerTlsConfig() (*tls.Config, error) {
                return t.serverTlsConfig, nil
        }
 
-       opts := append(tlsutil.DefaultClientTLSOptions(), t.toOptions()...)
-       conf, err := tlsutil.GetClientTLSConfig(opts...)
+       opts := append(tlsutil.DefaultServerTLSOptions(), t.toOptions()...)
+       conf, err := tlsutil.GetServerTLSConfig(opts...)
        if err != nil {
                log.Error("get server tls config failed", err)
        }
diff --git a/syncer/server/handler.go b/syncer/server/handler.go
index a913331..d18a20b 100644
--- a/syncer/server/handler.go
+++ b/syncer/server/handler.go
@@ -102,7 +102,7 @@ func (s *Server) userEvent(event serf.UserEvent) {
        }
        var tlsConfig *tls.Config
        if enabled {
-               tlsConfig, err = s.conf.TLSConfig.ServerTlsConfig()
+               tlsConfig, err = s.conf.TLSConfig.ClientTlsConfig()
                if err != nil {
                        log.Error("get grpc client tls config failed", err)
                        return

Reply via email to