# grpc **Repository Path**: chntzy/grpc ## Basic Information - **Project Name**: grpc - **Description**: grpc学习 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2020-06-09 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # grpc #### 介绍 + grpc学习 + bat 的简单使用 + protoc buffer https://github.com/protocolbuffers/protobuf/releases ### protoc相关 ``` go get -u github.com/golang/protobuf/proto go get -u github.com/golang/protobuf/protoc-gen-go go get google.golang.org/grpc protoc --go_out=plugins=grpc:{输出目录} {proto文件} ``` ### 证书 + 生成根证书 ``` openssl genrsa -out ca.key 2048 openssl req -new -x509 -days 3650 -key ca.key -out ca.pem ``` + 生成服务端证书 ``` openssl genrsa -out server.key 2048 openssl req -new -key server.key -out server.csr openssl x509 -req -sha256 -CA ca.pem -CAkey ca.key -CAcreateserial -days 365 -in server.csr -out server.pem ``` + 生成客户端证书 ``` openssl ecparam -genkey -name secp384r1 -out client.key openssl req -new -key client.key -out client.csr openssl x509 -req -sha256 -CA ca.pem -CAkey ca.key -CAcreateserial -days 365 -in client.csr -out client.pem ``` ### 其他指令 ``` go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger ```