I have a grpc based client-server app on .NET Framework(no .NET Core libraries used) .I want to secure the connection using SSL encryption.I know it can be done by using SslServerCredentials on the server side and SslCredentials on the client side passed onto the channel which require a key-value pair along with other parameters.
Server side might look like this
SslServerCredentials creds = new SslServerCredentials(new List<KeyCertificatePair>() {keypair},rootCertificate,true);
Server server = new Server
{
Services = { GrpcTest.BindService(new GrpcTestImpl()) },
Ports = { new ServerPort("127.0.0.1", Port, creds) }
};
Client Side:-
var ssl = new SslCredentials(rootCertificate, new KeyCertificatePair(clientcert, clientkey));
channel = new Channel("localhost", 555, ssl);
client = new GrpcTest.GrpcTestClient(channel);
Can I use this with X.509 certificates? I don't know how to integrate both of them?