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

alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
     new f83adb166 fix(remoting): Refine Getty server TLS configuration (#3156)
f83adb166 is described below

commit f83adb16689a142f4540635ac749651c5b195af5
Author: 陈钢阳 <[email protected]>
AuthorDate: Mon Jan 12 10:02:19 2026 +0800

    fix(remoting): Refine Getty server TLS configuration (#3156)
    
    Corrected a log message from 'client' to 'server' in Getty's TLS 
initialization.
    Enhanced server TLS setup by adding a validation check 
(`dubbotls.IsServerTLSValid`) before enabling SSL.
    Removed redundant TLS configuration logic to simplify the code path
---
 remoting/getty/getty_server.go | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/remoting/getty/getty_server.go b/remoting/getty/getty_server.go
index 49cddadff..5178b72fd 100644
--- a/remoting/getty/getty_server.go
+++ b/remoting/getty/getty_server.go
@@ -96,14 +96,14 @@ func initServer(url *common.URL) {
                        if tlsConfRaw, ok := 
url.GetAttribute(constant.TLSConfigKey); ok {
                                tlsConf, ok := tlsConfRaw.(*global.TLSConfig)
                                if !ok {
-                                       logger.Errorf("Getty client initialized 
the TLSConfig configuration failed")
+                                       logger.Errorf("Getty Server initialized 
the TLSConfig configuration failed")
                                        return
                                }
                                tlsConfig = tlsConf
                        }
                }
 
-               if tlsConfig != nil {
+               if tlsConfig != nil && dubbotls.IsServerTLSValid(tlsConfig) {
                        srvConf.SSLEnabled = true
                        srvConf.TLSBuilder = &getty.ServerTlsConfigBuilder{
                                ServerKeyCertChainPath:        
tlsConfig.TLSCertFile,
@@ -111,22 +111,6 @@ func initServer(url *common.URL) {
                                ServerTrustCertCollectionPath: 
tlsConfig.CACertFile,
                        }
                        logger.Infof("Getty Server initialized the TLSConfig 
configuration")
-               } else if tlsConfRaw, ok := 
url.GetAttribute(constant.TLSConfigKey); ok {
-                       // use global TLSConfig handle tls
-                       tlsConf, ok := tlsConfRaw.(*global.TLSConfig)
-                       if !ok {
-                               logger.Errorf("Getty Server initialized the 
TLSConfig configuration failed")
-                               return
-                       }
-                       if dubbotls.IsServerTLSValid(tlsConf) {
-                               srvConf.SSLEnabled = true
-                               srvConf.TLSBuilder = 
&getty.ServerTlsConfigBuilder{
-                                       ServerKeyCertChainPath:        
tlsConf.TLSCertFile,
-                                       ServerPrivateKeyPath:          
tlsConf.TLSKeyFile,
-                                       ServerTrustCertCollectionPath: 
tlsConf.CACertFile,
-                               }
-                               logger.Infof("Getty Server initialized the 
TLSConfig configuration")
-                       }
                }
                //getty params
                gettyServerConfig := protocolConf.Params

Reply via email to