34 lines
894 B
Markdown
34 lines
894 B
Markdown
![]() |
## GRPC
|
||
|
|
||
|
### 生成proto
|
||
|
|
||
|
```javasrript
|
||
|
protoc --go_out=plugins=grpc:. *.proto
|
||
|
```
|
||
|
### 完整示例:
|
||
|
|
||
|
```javasrript
|
||
|
protoc --go_out=plugins=grpc,Mfoo/bar.proto=bar,import_prefix=,import_path=foo/bar:. ./*.proto
|
||
|
```
|
||
|
|
||
|
### TLS私钥和公钥
|
||
|
- TLS私钥和公钥
|
||
|
- 制作私钥 (.key)
|
||
|
```sh
|
||
|
openssl genrsa -out server.key 2048
|
||
|
```
|
||
|
```sh
|
||
|
openssl ecparam -genkey -name secp384r1 -out server.key
|
||
|
```
|
||
|
```sh
|
||
|
openssl req -new -x509 -sha256 -key server.key -out server.pem -days 3650
|
||
|
```
|
||
|
```sh
|
||
|
Country Name (2 letter code) [AU]:CN
|
||
|
State or Province Name (full name) [Some-State]:Anhui
|
||
|
Locality Name (eg, city) []:Hefei
|
||
|
Organization Name (eg, company) [Internet Widgits Pty Ltd]:IPEACE.ORG.CN
|
||
|
Organizational Unit Name (eg, section) []:DEVELOPER
|
||
|
Common Name (e.g. server FQDN or YOUR name) []:TOKYO_HOT.RPC
|
||
|
Email Address []:email@ipeace.org.cn
|
||
|
```
|