grpc / grpc/grpc-java

Support SslMasterKeyHandler in NettyServerBuilder

Aperta
#7,199 15 commenti 1 reazione 0 assegnatari Vedi su GitHub
enhancement good first issue
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

I have a problem with adding SslMasterKeyHandler#newWireSharkSslMasterKeyHandler on the server side. I tried to do this with channelFactory:
```
builder.channelFactory(() -> {
final ServerChannel ch = GrpcUtil.getDefaultServerChannelFactory().newChannel();
final ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(SslMasterKeyHandler.newWireSharkSslMasterKeyHandler());
return ch;
})
```
and later with ProtocolNegotiator:
```
final SslContext sslContext = GrpcSslContexts.configure(sslClientContextBuilder).build();
final io.grpc.netty.ProtocolNegotiator negotiator = ProtocolNegotiators.serverTls(sslContext);
builder.protocolNegotiator(tlsNegotiator(negotiator);
```

In the first case, the setting had no effect. In the second case, the server worked incorrectly (it stopped accepting connections, even without a handler, just with a negotiator wrapper).

What should be the proper implementation?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.