Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible to support tls? #1312

Open
ouvaa opened this issue Mar 24, 2024 · 3 comments
Open

possible to support tls? #1312

ouvaa opened this issue Mar 24, 2024 · 3 comments

Comments

@ouvaa
Copy link

ouvaa commented Mar 24, 2024

what is the current workaround other than putting a tls terminator e.g. nginx in front?

hertz already have tls, just wondering why / how does hertz have it when netpoll and kitex cant have it. not sure how the tls layer is done.

also, how much work is it to port hertz's tls to netpoll / kitex etc?
sry for my newbie question.

@GuangmingLuo
Copy link
Member

As you know, TLS is not supported in Netpoll.
For Hertz, you may switch to go net lib instead if you need TLS.
For RPC (Kitex), it's similar. But I recommand to use Envoy as a sidecar to support mTLS.

@kolinfluence
Copy link

i've tried chatgpt for answer but it's useless and not working.

can you show an example code for kitex rpc using tls? envoy is too troublesome and needing to route through tcp. would prefer to use tls code within prorgram.

@felix021
Copy link
Contributor

felix021 commented Mar 25, 2024

As replied before, Kitex doesn't support TLS natively with netpoll.

You may switch to gonet with server.WithTransHandlerFactory:

f := detection.NewSvrTransHandlerFactory(
    gonet.NewSvrTransHandlerFactory(),
    nphttp2.NewSvrTransHandlerFactory(), // it's necessary for gRPC support
)

svr := yourservice.NewServer(handler, server.WithTransHandlerFactory(f))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants