grpc / grpc/grpc-java

Support for TLS/plaintext Port Unification

オープン
#9,002 コメント 11 件 リアクション 1 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 17時間
マージ済み PR(30日)
37

説明

### Is your feature request related to a problem?

While trying to work with TLS, I was scanning through the current server setup. The NettyServerBuilder configures the port to be TLS or plaintext based on the presence or absence of `SslContext`, correspondingly.
https://github.com/grpc/grpc-java/blob/012dbaf5be3fb0d532d977d288a0e42a58f30a7c/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java#L352-L364

Resulting in a very little flexibility for the users to customize the port. Specifically, I was trying to see if we can accept both TLS & non-TLS connections on the same port without the need for creating a duplicate port. Netty demonstrates this through the [doc](https://netty.io/4.1/xref/io/netty/example/portunification/PortUnificationServerHandler.html#PortUnificationServerHandler).

### Describe the solution you'd like

**Approach1**
Explicit public interface in `NettyServerBuilder` for enabling/disabling/multiplexing TLS.
We could follow a [similar approach](https://netty.io/4.1/xref/io/netty/example/portunification/PortUnificationServerHandler.html#PortUnificationServerHandler) of spiffing the initial bytes & dynamically configuring TLS.

**Approach2**
A public interface for adding child handlers to customize the connections.
https://github.com/grpc/grpc-java/blob/012dbaf5be3fb0d532d977d288a0e42a58f30a7c/netty/src/main/java/io/grpc/netty/NettyServer.java#L228

### Additional context

Relevant thread in stackoverflow:
https://stackoverflow.com/questions/71484231/port-unification-in-grpc-java

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with NettyServerBuilder.java at the TLS/plaintext configuration around lines 352-364, then inspect NettyServer.java around line 228 and the linked Netty PortUnificationServerHandler example. Compare the two proposed public interfaces and define how one port should accept both TLS and non-TLS connections without requiring a duplicate port.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
backend-api-design, networking
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。