WCF with NetTcpBinding Network Security and Certificate Certificate

I need to protect a WCF service that uses netTcpBinding and connects directly to a Windows Forms application. I need it to be fixed at the transport level.

I am sure that it works locally, i.e. I can start the service locally and connect to it with the client.

When I try to configure the service to work on the server, and not on my local computer, I have problems with certificates. The error log states that the certificate must have a private key capable of exchanging keys, and that the process must have access rights for the private key.

I am using a development certificate created with makecert.

makecert -n "CN=MY COMPANY DEBUG" -pe -sky exchange Debug.cer 

I must admit that I am very new to using certificates. Does anyone have any guidance on how I can fix this, or a better way to use a certificate to add transport security to a WCF service using netTcpBinding?

Thanks.

+3
source share
2 answers

Try the following:

 makecert -n "CN=MY COMPANY DEBUG" -pe -sky exchange Debug.cer -sv Debug.pvk pvk2pfx -pvk Debug.pvk -spc Debug.cer -pfx Debug.pfx 

Then you get three files: a .cer file (public key),. Pvk (private key) and .pfx (key exchange with both). Then you can install the .pfx file on the server as follows:

 certutil -p "" -importPFX Certificates\Debug.pfx 

On the client side, you only need to install the .cer file. You can also perform these settings (.cer and .pfx above) using the MMC Certificates snap-in (Start, Run, MMC.exe, and then add the Certificates snap-in for the current computer).

+6
source

Read this (covers the https case, but might still help) and that .

Since we are talking about transport-level security, I don’t think your server process should know anything about the certificate that you use to provide it.

0
source

Source: https://habr.com/ru/post/891149/


All Articles