生成SSL证书
生成私钥
openssl genrsa -out server.key 2048
通过私钥生成 crt
server_host 是访问的地址 stdpain.cc
openssl req -new -x509 -days 3650 \
-subj "/C=GB/L=China/O=grpc-server/CN=$server_host" \
-key server.key -out server.crt
验证客户端
openssl s_client -connect $ip:$port -servername $server_host
参考:
https://www.jianshu.com/p/3e660cb3cf32
https://www.imooc.com/wenda/detail/571343