Snow-kal commented on code in PR #3231:
URL: https://github.com/apache/dubbo-go/pull/3231#discussion_r2936177147


##########
protocol/grpc/server.go:
##########
@@ -107,23 +104,9 @@ func (s *Server) Start(url *common.URL) {
                grpc.MaxSendMsgSize(maxServerSendMsgSize),
        )
 
-       // TODO: remove config TLSConfig
-       // delete this branch
-       tlsConfig := config.GetRootConfig().TLSConfig
-       if tlsConfig != nil {
-               var cfg *tls.Config
-               cfg, err = config.GetServerTlsConfig(&config.TLSConfig{
-                       CACertFile:    tlsConfig.CACertFile,
-                       TLSCertFile:   tlsConfig.TLSCertFile,
-                       TLSKeyFile:    tlsConfig.TLSKeyFile,
-                       TLSServerName: tlsConfig.TLSServerName,
-               })
-               if err != nil {
-                       return
-               }
-               logger.Infof("gRPC Server initialized the TLSConfig 
configuration")
-               serverOpts = append(serverOpts, 
grpc.Creds(credentials.NewTLS(cfg)))
-       } else if tlsConfRaw, ok := url.GetAttribute(constant.TLSConfigKey); ok 
{
+       var transportCreds credentials.TransportCredentials
+       transportCreds = insecure.NewCredentials()
+       if tlsConfRaw, ok := url.GetAttribute(constant.TLSConfigKey); ok {

Review Comment:
   感谢建议 直接按 defer 模式修改
   <img width="1614" height="753" alt="image" 
src="https://github.com/user-attachments/assets/9ddfb60f-ecd5-465e-bc11-9349cd7fed5e";
 />
   <img width="1643" height="495" alt="image" 
src="https://github.com/user-attachments/assets/e9abe26f-ecba-4569-b587-18dcf0028eaf";
 />
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to