You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/03/14 23:56:19 UTC

[GitHub] [dubbo-go-samples] cjphaha opened a new pull request #68: add: tls sample

cjphaha opened a new pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] cjphaha commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
cjphaha commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r600695992



##########
File path: tls/README_zh.md
##########
@@ -0,0 +1,63 @@
+## tls加密传输
+
+dubbo-go的tls加密传输是通过dubbo-getty实现的https://github.com/apache/dubbo-getty,在使用tls之前,需要准备好
+
++ ca证书文件
++ client和server的密钥及证书文件
+
+也可以使用certs文件夹中的样例文件
+
+```shell
+├── certs
+│   ├── ca.key
+│   ├── ca.pem
+│   ├── client.key
+│   ├── client.pem
+│   ├── server.key
+│   └── server.pem
+```
+
+### Server端
+
+可以在运行`config.Load()`之前导入配置
+
+```go
+func init(){
+  // 证书
+	serverPemPath, _ := filepath.Abs("../../certs/server.pem")
+  // 私钥
+	serverKeyPath, _ := filepath.Abs("../../certs/server.key")
+  // ca证书
+	caPemPath, _ := filepath.Abs("../../certs/ca.pem")
+  // 开启tls
+	config.SetSslEnabled(true)
+  // 导入tls配置
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+```
+
+### Client端
+
+client端的设置和server端类似,不需要设置证书
+
+```go
+func init(){
+  // 私钥
+	clientKeyPath, _ := filepath.Abs("../certs/ca.key")
+  // ca证书
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+  // 开启tls
+	config.SetSslEnabled(true)
+  // 导入tls配置
+	config.SetClientTlsConfigBuilder(&getty.ClientTlsConfigBuilder{
+		ClientPrivateKeyPath:          clientKeyPath,
+		ClientTrustCertCollectionPath: caPemPath,
+	})
+}
+```
+
+其余设置同helloworld保持一致皆可。

Review comment:
       I have modified it in the commit later, sorry for the trouble!




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] cjphaha commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
cjphaha commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r600692917



##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+// 生存时间
+var (
+	survivalTimeout = 	int(3e9)
+)
+
+func init(){
+	serverPemPath, _ := filepath.Abs("../certs/server.pem")
+	serverKeyPath, _ := filepath.Abs("../certs/server.key")
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+	config.SetSslEnabled(true)
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+
+/*
+	需要配置环境变量
+	export CONF_PROVIDER_FILE_PATH="xx"
+	export APP_LOG_CONF_FILE="xx"
+ */
+
+func main() {
+	// 在运行的时候序列化
+	hessian.RegisterPOJO(&pkg.User{})
+	// 加载配置
+	config.Load()
+	// 优雅的结束程序
+	initSignal()
+}
+
+// 优雅的结束程序

Review comment:
       I have modified the problems in PR, thank you very much!




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r600174713



##########
File path: tls/README_zh.md
##########
@@ -0,0 +1,63 @@
+## tls加密传输
+
+dubbo-go的tls加密传输是通过dubbo-getty实现的https://github.com/apache/dubbo-getty,在使用tls之前,需要准备好
+
++ ca证书文件
++ client和server的密钥及证书文件
+
+也可以使用certs文件夹中的样例文件
+
+```shell
+├── certs
+│   ├── ca.key
+│   ├── ca.pem
+│   ├── client.key
+│   ├── client.pem
+│   ├── server.key
+│   └── server.pem
+```
+
+### Server端
+
+可以在运行`config.Load()`之前导入配置
+
+```go
+func init(){
+  // 证书
+	serverPemPath, _ := filepath.Abs("../../certs/server.pem")
+  // 私钥
+	serverKeyPath, _ := filepath.Abs("../../certs/server.key")
+  // ca证书
+	caPemPath, _ := filepath.Abs("../../certs/ca.pem")
+  // 开启tls
+	config.SetSslEnabled(true)
+  // 导入tls配置
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+```
+
+### Client端
+
+client端的设置和server端类似,不需要设置证书
+
+```go
+func init(){
+  // 私钥
+	clientKeyPath, _ := filepath.Abs("../certs/ca.key")
+  // ca证书
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+  // 开启tls
+	config.SetSslEnabled(true)
+  // 导入tls配置
+	config.SetClientTlsConfigBuilder(&getty.ClientTlsConfigBuilder{
+		ClientPrivateKeyPath:          clientKeyPath,
+		ClientTrustCertCollectionPath: caPemPath,
+	})
+}
+```
+
+其余设置同helloworld保持一致皆可。

Review comment:
       补充下 hello world 项目的连接




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r600175102



##########
File path: tls/go-client/conf/client.yml
##########
@@ -0,0 +1,61 @@
+# dubbo client yaml configure file
+
+
+check: true
+# client
+request_timeout : "3s"
+# connect timeout
+connect_timeout : "3s"
+
+# application config
+application:
+  organization : "ikurento.com"
+  name  : "BDTService"
+  module : "dubbogo user-info client"
+  version : "0.0.1"
+  owner : "ZX"
+  environment : "dev"
+
+registries :
+  "demoZk":
+    protocol: "zookeeper"
+    timeout	: "3s"
+    address: "127.0.0.1:2181"
+    usern ame: ""
+    password: ""
+
+
+references:
+  "UserProvider":
+    # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册

Review comment:
       why remove this line? maybe we can translate it into english.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] cjphaha commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
cjphaha commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r599213491



##########
File path: tls/go-server/conf/server.yml
##########
@@ -0,0 +1,57 @@
+# dubbo server yaml configure file
+
+
+# application config
+application:
+  organization : "ikurento.com"
+  name : "BDTService"
+  module : "dubbogo user-info server"
+  version : "0.0.1"
+  owner : "ZX"
+  environment : "dev"
+
+registries :
+  "demoZk":
+    protocol: "zookeeper"
+    timeout	: "3s"
+    address: "127.0.0.1:2181"
+
+services:
+  "UserProvider":
+    # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
+    registry: "demoZk"
+    protocol : "dubbo"
+    # 相当于dubbo.xml中的interface

Review comment:
       > remove this line.
   Thank you for reviewing the code for me. I'll change it later!




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r602860428



##########
File path: tls/go-server/pkg/user.go
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package pkg
+
+import (
+	"context"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/config"
+)
+
+func init() {
+	config.SetProviderService(new(UserProvider))
+	// ------for hessian2------
+	hessian.RegisterPOJO(&User{})
+}
+
+type User struct {
+	Id   string
+	Name string
+	Age  int32
+	Time time.Time
+}
+
+type UserProvider struct {
+	

Review comment:
       pls delete this blank line




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r602901655



##########
File path: tls/go-server/pkg/user.go
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package pkg
+
+import (
+	"context"
+	"time"
+)
+
+import (
+	"github.com/dubbogo/gost/log"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/config"
+)
+
+func init() {
+	config.SetProviderService(new(UserProvider))
+	// ------for hessian2------
+	hessian.RegisterPOJO(&User{})
+}
+
+type User struct {
+	Id   string

Review comment:
       pls change the Id to ID in this sample.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks merged pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
AlexStocks merged pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] AlexStocks commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r600174314



##########
File path: tls/README.md
##########
@@ -0,0 +1,61 @@
+## TLS encrypted transmission
+
+The TLS encrypted transmission of Dubbo go is realized by Dubbo Getty https://github.com/apache/dubbo-getty . Before using TLS, you need to be prepared as follows.

Review comment:
       dubbo-go. dubbo-getty. 




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] beiwei30 commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
beiwei30 commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r594028376



##########
File path: tls/go-client/app/client.go
##########
@@ -0,0 +1,84 @@
+package main

Review comment:
       pls. add apache license header

##########
File path: tls/go-server/app/version.go
##########
@@ -0,0 +1,5 @@
+package main

Review comment:
       remove it.

##########
File path: tls/go-server/app/user.go
##########
@@ -0,0 +1,47 @@
+package main

Review comment:
       pls. add apache license header.

##########
File path: tls/go-server/app/server.go
##########
@@ -0,0 +1,80 @@
+package main

Review comment:
       pls. add apache license header.

##########
File path: tls/go-client/app/env.sh
##########
@@ -0,0 +1,3 @@
+export CONF_CONSUMER_FILE_PATH=../profiles/dev/client.yml

Review comment:
       avoid use shell script to start. try if build/makefile work or not. pls. refer to HOWTO.md

##########
File path: tls/go-server/app/start.sh
##########
@@ -0,0 +1,4 @@
+export CONF_PROVIDER_FILE_PATH="../conf/server.yml"

Review comment:
       avoid use shell script to start. try if build/makefile work or not. pls. refer to HOWTO.md
   
   

##########
File path: tls/go-server/app/env.sh
##########
@@ -0,0 +1,2 @@
+export CONF_PROVIDER_FILE_PATH="../profiles/dev/server.yml"

Review comment:
       avoid use shell script to start. try if build/makefile work or not. pls. refer to HOWTO.md

##########
File path: tls/go-client/app/start.sh
##########
@@ -0,0 +1,3 @@
+export CONF_CONSUMER_FILE_PATH="../conf/client.yml"

Review comment:
       avoid use shell script to start. try if build/makefile work or not. pls. refer to HOWTO.md

##########
File path: tls/go-client/app/user.go
##########
@@ -0,0 +1,34 @@
+package main

Review comment:
       pls. add apache license.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-samples] beiwei30 commented on a change in pull request #68: add: tls sample

Posted by GitBox <gi...@apache.org>.
beiwei30 commented on a change in pull request #68:
URL: https://github.com/apache/dubbo-go-samples/pull/68#discussion_r599204937



##########
File path: tls/go-client/cmd/client.go
##########
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"context"
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	hessian "github.com/apache/dubbo-go-hessian2"
+	gxlog "github.com/dubbogo/gost/log"
+	"github.com/apache/dubbo-go-samples/tls/go-client/pkg"

Review comment:
       put "tls/go-client/pkg" into separated import group, and combine others into the group below.

##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"

Review comment:
       again, pls. regroup the import. Move 'tls/go-server/pkg' into separated package.

##########
File path: tls/go-server/conf/server.yml
##########
@@ -0,0 +1,57 @@
+# dubbo server yaml configure file
+
+
+# application config
+application:
+  organization : "ikurento.com"
+  name : "BDTService"
+  module : "dubbogo user-info server"
+  version : "0.0.1"
+  owner : "ZX"
+  environment : "dev"
+
+registries :
+  "demoZk":
+    protocol: "zookeeper"
+    timeout	: "3s"
+    address: "127.0.0.1:2181"
+
+services:
+  "UserProvider":
+    # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册

Review comment:
       remote this line of comment

##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+// 生存时间
+var (
+	survivalTimeout = 	int(3e9)
+)
+
+func init(){
+	serverPemPath, _ := filepath.Abs("../certs/server.pem")
+	serverKeyPath, _ := filepath.Abs("../certs/server.key")
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+	config.SetSslEnabled(true)
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+
+/*
+	需要配置环境变量
+	export CONF_PROVIDER_FILE_PATH="xx"
+	export APP_LOG_CONF_FILE="xx"
+ */
+
+func main() {
+	// 在运行的时候序列化
+	hessian.RegisterPOJO(&pkg.User{})
+	// 加载配置
+	config.Load()
+	// 优雅的结束程序
+	initSignal()
+}
+
+// 优雅的结束程序

Review comment:
       use English for comments.

##########
File path: tls/go-client/conf/client.yml
##########
@@ -0,0 +1,61 @@
+# dubbo client yaml configure file
+
+
+check: true
+# client
+request_timeout : "3s"
+# connect timeout
+connect_timeout : "3s"
+
+# application config
+application:
+  organization : "ikurento.com"
+  name  : "BDTService"
+  module : "dubbogo user-info client"
+  version : "0.0.1"
+  owner : "ZX"
+  environment : "dev"
+
+registries :
+  "demoZk":
+    protocol: "zookeeper"
+    timeout	: "3s"
+    address: "127.0.0.1:2181"
+    usern ame: ""
+    password: ""
+
+
+references:
+  "UserProvider":
+    # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册

Review comment:
       remove this line of comment.

##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+// 生存时间
+var (
+	survivalTimeout = 	int(3e9)
+)
+
+func init(){
+	serverPemPath, _ := filepath.Abs("../certs/server.pem")
+	serverKeyPath, _ := filepath.Abs("../certs/server.key")
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+	config.SetSslEnabled(true)
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+
+/*

Review comment:
       use English for comments.

##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+// 生存时间
+var (
+	survivalTimeout = 	int(3e9)
+)
+
+func init(){
+	serverPemPath, _ := filepath.Abs("../certs/server.pem")
+	serverKeyPath, _ := filepath.Abs("../certs/server.key")
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+	config.SetSslEnabled(true)
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+
+/*
+	需要配置环境变量
+	export CONF_PROVIDER_FILE_PATH="xx"
+	export APP_LOG_CONF_FILE="xx"
+ */
+
+func main() {
+	// 在运行的时候序列化
+	hessian.RegisterPOJO(&pkg.User{})
+	// 加载配置

Review comment:
       use English for comments.

##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+// 生存时间

Review comment:
       use English for comments.

##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+// 生存时间
+var (
+	survivalTimeout = 	int(3e9)
+)
+
+func init(){
+	serverPemPath, _ := filepath.Abs("../certs/server.pem")
+	serverKeyPath, _ := filepath.Abs("../certs/server.key")
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+	config.SetSslEnabled(true)
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+
+/*
+	需要配置环境变量
+	export CONF_PROVIDER_FILE_PATH="xx"
+	export APP_LOG_CONF_FILE="xx"
+ */
+
+func main() {
+	// 在运行的时候序列化
+	hessian.RegisterPOJO(&pkg.User{})
+	// 加载配置
+	config.Load()
+	// 优雅的结束程序

Review comment:
       use English for comments.

##########
File path: tls/go-server/cmd/server.go
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+	"fmt"
+	"os"
+	"os/signal"
+	"path/filepath"
+	"syscall"
+	"time"
+)
+
+import (
+	getty "github.com/apache/dubbo-getty"
+	"github.com/apache/dubbo-go-samples/tls/go-server/pkg"
+	hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
+	"github.com/apache/dubbo-go/common/logger"
+	"github.com/apache/dubbo-go/config"
+	_ "github.com/apache/dubbo-go/protocol/dubbo"
+	_ "github.com/apache/dubbo-go/registry/protocol"
+	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
+	_ "github.com/apache/dubbo-go/filter/filter_impl"
+	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
+	_ "github.com/apache/dubbo-go/cluster/loadbalance"
+	_ "github.com/apache/dubbo-go/registry/zookeeper"
+)
+
+// 生存时间
+var (
+	survivalTimeout = 	int(3e9)
+)
+
+func init(){
+	serverPemPath, _ := filepath.Abs("../certs/server.pem")
+	serverKeyPath, _ := filepath.Abs("../certs/server.key")
+	caPemPath, _ := filepath.Abs("../certs/ca.pem")
+	config.SetSslEnabled(true)
+	config.SetServerTlsConfigBuilder(&getty.ServerTlsConfigBuilder{
+		ServerKeyCertChainPath:        serverPemPath,
+		ServerPrivateKeyPath:          serverKeyPath,
+		ServerTrustCertCollectionPath: caPemPath,
+	})
+}
+
+/*
+	需要配置环境变量
+	export CONF_PROVIDER_FILE_PATH="xx"
+	export APP_LOG_CONF_FILE="xx"
+ */
+
+func main() {
+	// 在运行的时候序列化

Review comment:
       use English for comments.

##########
File path: tls/go-client/pkg/user.go
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package pkg
+
+import (
+	"context"
+	"time"
+)
+
+type User struct {

Review comment:
       pls. reformat the code.

##########
File path: tls/go-server/conf/server.yml
##########
@@ -0,0 +1,57 @@
+# dubbo server yaml configure file
+
+
+# application config
+application:
+  organization : "ikurento.com"
+  name : "BDTService"
+  module : "dubbogo user-info server"
+  version : "0.0.1"
+  owner : "ZX"
+  environment : "dev"
+
+registries :
+  "demoZk":
+    protocol: "zookeeper"
+    timeout	: "3s"
+    address: "127.0.0.1:2181"
+
+services:
+  "UserProvider":
+    # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
+    registry: "demoZk"
+    protocol : "dubbo"
+    # 相当于dubbo.xml中的interface

Review comment:
       remove this line.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org