TLS support for GRPC in C#

前端 未结 1 1599
野性不改
野性不改 2021-01-02 16:36

I\'m rather new to C#, and I need to use GRPC over TLS.

As a dry-run, I\'m modifying the example provided in the main grpc repo to use TLS. To do this, I found anoth

相关标签:
1条回答
  • 2021-01-02 17:34

    Your code is implementing Mutual TLS with self signed certs correctly - I was able to run it on windows netcore without any changes.

    I did have to tweak the certificate generation script a little:

    • Adding environment variable definition for CLIENT-COMPUTERNAME, used for the client /CN (Common Name)
    • Adding a -config option to get rid of unable to find 'distinguished_name' in config error (might be a openssl on Windows thing)

    I was able to reproduce the same error message that you had by deliberately mismatching the host that the client connects to (127.0.0.1 instead of localhost). So maybe you just need to regenerate your keys with e.g. localhost as the client's common name.

    0 讨论(0)
提交回复
热议问题