Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改在数字证书签发过程中表述不清楚 #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/posts/go/grpc/2018-10-08-ca-tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ tags:
- 公钥
- 密钥

### 生成 Key
### 生成CA自身的Key(私钥)

```
openssl genrsa -out ca.key 2048
```

### 生成密钥
### 使用CA自己的私钥生成自签名证书

```
openssl req -new -x509 -days 7200 -key ca.key -out ca.pem
Expand Down Expand Up @@ -75,7 +75,7 @@ to be sent with your certificate request
A challenge password []:
```

CSR 是 Cerificate Signing Request 的英文缩写,为证书请求文件。主要作用是 CA 会利用 CSR 文件进行签名使得攻击者无法伪装或篡改原有证书
CSR 是 Cerificate Signing Request 的英文缩写,为证书请求文件。主要作用是:如果有客户(比如我们这个文章中需要通信的客户端和服务端) 需要CA生成数字证书,首先客户自己会使用自己的私钥来生成 CSR 文件,接下来客户就可以把CSR文件发送给CA,CA可以根据客户的 CSR 文件给客户签发数字证书。在本文的例子中,客户端和服务端拿到CA签发的数字证书后就可以进行TLS/SSL握手(使用数字证书相互鉴别身份,协商对称秘钥),数字证书是PKI(公钥基础设施)中重要的概念之一,读者如果想深入可以学习公钥密码学。

#### 基于 CA 签发

Expand Down Expand Up @@ -309,4 +309,4 @@ func main() {

### 本系列示例代码

- [go-grpc-example](https://github.com/EDDYCJY/go-grpc-example)
- [go-grpc-example](https://github.com/EDDYCJY/go-grpc-example)
4 changes: 2 additions & 2 deletions content/posts/go/grpc/2018-10-12-grpc-http.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func GetHTTPServeMux() *http.ServeMux {

### Client

simple_http_server 目录下新建 client.go,写入文件内容:
simple_http_client 目录下新建 client.go,写入文件内容:

```
package main
Expand Down Expand Up @@ -218,4 +218,4 @@ $ go run client.go

### 本系列示例代码

- [go-grpc-example](https://github.com/EDDYCJY/go-grpc-example)
- [go-grpc-example](https://github.com/EDDYCJY/go-grpc-example)
4 changes: 2 additions & 2 deletions content/posts/go/grpc/2018-10-20-zipkin.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ go-grpc-example
### 安装

```
$ go get -u github.com/openzipkin/zipkin-go-opentracing
$ go get -u github.com/openzipkin-contrib/zipkin-go-opentracing
$ go get -u github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc
```

Expand All @@ -141,7 +141,7 @@ import (

"github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
zipkin "github.com/openzipkin-contrib/zipkin-go-opentracing"
"google.golang.org/grpc"

"github.com/EDDYCJY/go-grpc-example/pkg/gtls"
Expand Down