No, it is not possible. But this is not a gRPC problem, this is a problem 
of TCP and SSL/TLS. How should the receiver know if the packet is encrypted 
or not? How should the server know if the SSL/TLS handshake shall happen or 
not?
But you can do the following "workaround":
Assign two IP addresses to the same machine. Bind the unencrypted port to 
one of both IP addresses and bind the encrypted port to the other IP 
address. So, do not use 0.0.0.0 at AddListeningPort(), but a specific IP 
address. If you have these two different IP addresses, then you can use the 
same port for encrypted and also for unencrypted connections. The client 
can now decide on the IP address which kind of connection 
(encrypted/unencryped) it wants to use.

I hope, this will help you.

Cheers
Eberhard


Nagaraj Gidde schrieb am Freitag, 29. Oktober 2021 um 09:00:42 UTC+2:

> Hello All, 
>
> We have a complicated situation where need to support a secure and 
> insecure channel on single port for grpc server for backward compatibility. 
>
> Is it possible to have such config. Any thoughts on how to achieve will be 
> highly appreciated. 
>
> Thanks & Regards, 
> Nag. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/471957f7-5f13-4fb5-8cf9-5f7fe4373affn%40googlegroups.com.

Reply via email to