클라이언트와 서버간에 tls/ssl 연결을 만들고 싶습니다 (상호간, 편도가 아님). gRPC : TLS/SSL 작동을 위해 certificateChainFile 및 privateKeyFile 생성
이
내 설정이다 :서버 :
Server server = ServerBuilder.forPort(8443)
// Enable TLS
.useTransportSecurity(certChainFile, privateKeyFile)
.addService(new GreetingServiceImpl())
.build();
클라이언트
// With server authentication SSL/TLS
ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 8443)
.build();
GreetingServiceGrpc.GreetingServiceBlockingStub stub =
GreetingServiceGrpc.newBlockingStub(channel);
내가 필요로하는 모든 터미널 를 생성하는 명령 .PEM에 certChainFile 및 privateKeyFile (이다)이 파일을 serv에 전달합니다. er 코드를 사용하십시오.