You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/12/25 16:37:02 UTC

[dubbo-go-samples] branch master updated (d283143c -> b6abec07)

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

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


 discard d283143c update readme with async
     new b6abec07 update readme with async

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d283143c)
            \
             N -- N -- N   refs/heads/master (b6abec07)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md    | 2 +-
 README_CN.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


[dubbo-go-samples] 01/01: update readme with async

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b6abec0742141b6ecbe66b356c7127381027a416
Author: AlexStocks <al...@foxmail.com>
AuthorDate: Mon Dec 26 00:36:08 2022 +0800

    update readme with async
---
 README.md        |  1 +
 README_CN.md     |  3 ++-
 tls/README_zh.md | 47 +++++++++++++++++++++++------------------------
 3 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/README.md b/README.md
index 439a217a..a47918cb 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,7 @@
 ## What It Contains
 
 * apisix: apache/apisix and Dubbo-go example
+* async: the dubbogo callback[asynchronous] and call-one-way rpc example
 * config-api: show how to use dubbogo by APIs without configuration
 * configcenter: uses of different config centers, including zookeeper and nacos at present.
 * context: how to transfer request context between multiple producers/consumers
diff --git a/README_CN.md b/README_CN.md
index 47f3bb5e..ba5a049c 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -5,7 +5,8 @@
 ## 本工程包含的示例
 
 * apisix: apache/apisix 与 Dubbo-go 整合示例
-* config-api: 无需配置文件,使用 API 的方式启动服务、构造组件和使用。
+* async: dubbogo 通过 callback 方式进行异步 RPC 和call-one-way RPC
+* config-api: 无需配置文件,使用 API 的方式启动服务、构造组件和使用
 * configcenter: 使用不同的配置中心,目前支持:zookeeper、和 nacos
 * context: 如何通过 go context  把用户数据 attachment 从调用方传递给服务方
 * direct: 直连模式,无需注册中心,直连服务提供者
diff --git a/tls/README_zh.md b/tls/README_zh.md
index 51c401a5..a04806a0 100644
--- a/tls/README_zh.md
+++ b/tls/README_zh.md
@@ -1,25 +1,23 @@
-# 在Dubbo-go中使用TLS加密  
+## 1 背景
 
-## 背景  
+Dubbo-go在Getty/Triple/Grpc三个通信层面支持TLS链路安全通信。
 
-Dubbo-go在Getty/Triple/Grpc三个通信层面支持TLS链路安全通信。  
+## 2 原理
 
-## 原理  
-
-### 证书机制: 
+### 2.1 证书机制:
 
 ps: 可以先提前了解非对称加密机制。
 
-CA(Certification Authority)负责生成根证书、签发证书等等。CA自签证书的过程如下: 
+CA(Certification Authority)负责生成根证书、签发证书等等。CA自签证书的过程如下:
 
 1. CA生成公钥 ca_KeyPub 和私钥 ca_KeyPri,以及基本信息表 ca_Info。ca_Info 中一般包含了CA的名称、证书的有效期等信息。
 2. CA对(ca_KeyPub + ca_Info)进行散列运算,得到散列值 ca_Hash。
 3. CA使用其私钥 ca_KeyPri 对 ca_Hash 进行非对称加密,得到加密的散列值 enc_ca_Hash。
 4. CA将(ca_KeyPub + ca_Info + enc_ca_Hash)组合生成自签名的数字证书「ca_Cert」。这张证书称之为根证书。
 5. 根证书(ca_Cert)包含的内容:ca_KeyPub + ca_Info + enc_ca_Hash。
-(ca_Cert)可用于签署下一级的证书。根证书是自签名的,不需要其他机构认证。公钥私钥的生成可以利用OpenSSL等工具。
+   (ca_Cert)可用于签署下一级的证书。根证书是自签名的,不需要其他机构认证。公钥私钥的生成可以利用OpenSSL等工具。
 
-当需要签发证书时,在本地生成公钥和私钥,向CA发起CSR请求(Certificate Signing Request), CA校验此请求之后,颁发证书。过程如下:  
+当需要签发证书时,在本地生成公钥和私钥,向CA发起CSR请求(Certificate Signing Request), CA校验此请求之后,颁发证书。过程如下:
 
 1. 证书申请者(S)在本地生成公钥 s_KeyPub 和私钥 s_KeyPri,以及基本信息表 s_Info。s_Info 中一般包含了证书申请者的名称、证书有效期等信息。
 2. 证书申请者将 s_KeyPub、s_Info 发送给认证机构CA,即发起CSR请求。
@@ -29,20 +27,20 @@ CA(Certification Authority)负责生成根证书、签发证书等等。CA自签
 
 申请者的证书(s_Cert)包含的内容为:s_KeyPub + s_Info + ca_Info + enc_s_Hash。
 
-证书校验: 
+证书校验:
 
-用CA的公钥对 enc_s_Hash进行解密,得到s_Hash,对比其是否与 hash(s_KeyPub + s_Info + ca_Info)一致。 
+用CA的公钥对 enc_s_Hash进行解密,得到s_Hash,对比其是否与 hash(s_KeyPub + s_Info + ca_Info)一致。
 
-### TLS机制: 
+### 2.2 TLS机制:
 TLS 的前身是 SSL,用于通信加密,其主要过程如下:  
-在最简单的TLS机制中,只需要对客户端对服务端进行校验,所以只需要服务端有证书,客户端不需要,比如我们熟悉的HTTPS。其认证过程如下:  
+在最简单的TLS机制中,只需要对客户端对服务端进行校验,所以只需要服务端有证书,客户端不需要,比如我们熟悉的HTTPS。其认证过程如下:
 1. 客户端连接到服务端
 2. 服务器出示其 TLS 证书(s_cert),包括服务端公钥、CA的信息等。
 3. 客户端验证服务器的证书,用CA的公钥即可校验。
 4. 客户端和服务器通过加密的 TLS 连接交换信息
 
 
-除此之外,还有更安全的加密方式mTLS。在 mTLS 中,客户端和服务器都有一个证书,并且双方都使用它们的公钥/私钥对进行身份验证。其认证过程如下: 
+除此之外,还有更安全的加密方式mTLS。在 mTLS 中,客户端和服务器都有一个证书,并且双方都使用它们的公钥/私钥对进行身份验证。其认证过程如下:
 1. 客户端连接到服务端
 2. 服务端出示其 TLS 证书(s_cert),包括服务端公钥、服务端CA的信息等。
 3. 客户端验证服务端的证书,用服务端CA的公钥校验。
@@ -51,7 +49,7 @@ TLS 的前身是 SSL,用于通信加密,其主要过程如下:
 6. 服务端授予访问权限
 7. 客户端和服务器通过加密的 TLS 连接交换信息
 
-## 在Dubbo-go中使用TLS加密
+## 3 在Dubbo-go中使用 TLS 加密
 
 0.生成所需要的证书和秘钥 本示例提供已经生成好的证书和秘钥,在目录`tls/x509`下
 
@@ -79,32 +77,33 @@ dubbo:
     tls-server-name: dubbogo.test.example.com
 ```
 
-2. 启动示例  
+2. 启动示例
 
 本示例提供了Dubbo、Grpc、Triple三种通信方式的TLS加密示例,分别位于`tls/dubbo` 、`tls/grpc` 、`tls/triple`。进入文件夹即可启动示例。
 
 以tls/dubbo为例:
 
-* step1: 启动服务端: 
+* step1: 启动服务端:
 
 进入`tls/dubbo/go-server/cmd`,启动`server.go`
 
-看到如下日志,则TLS配置生效  
+看到如下日志,则TLS配置生效
 
 ```
 2022-12-01T23:39:30.690+0800    INFO    getty/getty_server.go:78        Getty Server initialized the TLSConfig configuration
 ```
 
-* step2: 启动客户端:   
- 
+* step2: 启动客户端:
+
 进入`tls/dubbo/go-client/cmd`,启动`client.go`
 
-看到如下日志,则TLS配置生效   
+看到如下日志,则TLS配置生效
 
 ```
 2022-12-01T23:40:05.998+0800    INFO    grpc/client.go:90       Grpc Client initialized the TLSConfig configuration
 ```
 
-## 参考
-https://zhuanlan.zhihu.com/p/36832100
-https://www.cloudflare.com/zh-cn/learning/access-management/what-is-mutual-tls/
\ No newline at end of file
+## 4 参考
+
+* 1 https://zhuanlan.zhihu.com/p/36832100
+* 2 https://www.cloudflare.com/zh-cn/learning/access-management/what-is-mutual-tls/