grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.56k stars 762 forks source link

Is it possible to do Mutual TLS(or client certificate authentication) in grpc-web against a grpc java server? #1179

Closed umapriyadarsi closed 2 years ago

umapriyadarsi commented 2 years ago

Put simply I want to know if I can have a frontend using grpc in javascript and be compatible with client certificate authentication against a grpc java server as documented here in grpc-java's SECURITY.md ?

sampajano commented 2 years ago

Hi :)

I'm assuming you're talking about a browser environment?

As far as i understand, i don't think something like specifying a SSL certificate is possible in a browser environment.. (usually auth are done using HTTP headers etc.)

But if you're asking about a Node server then i'm not really sure.. But at least there isn't any code in the grpc-web JS library that knows how to handle SSL certs..

Hope that answers your question.. :)

umapriyadarsi commented 2 years ago

@sampajano thanks for that. Two more questions please:

FYI, for my user facing application I wanted to use browser but because of the above two known limitations in gRPC-Web I couldn't opt for gRPC-Web.

sampajano commented 2 years ago

is mutual TLS in the roadmap at least for gRPC-Web?

No sorry it's not currently. Do you have any pointers to how to possibly do that from the browser? It's new to me entirely.. :)

Will gRPC-Web ever work without a proxy?

Also not likely.. AFAIU this is because browsers do not provide the HTTP/2 APIs (e.g. framing) needed by the native gRPC protocol. See documentation on the grpc-web protocol for more details.

FYI, for my user facing application I wanted to use browser but because of the above two known limitations in gRPC-Web I couldn't opt for gRPC-Web.

Yeah understood. Sorry for the current limitations :)