简体   繁体   中英

WCF client self-signed certificate

I want to enable https for my WCF service and limit usage to only 1 client using client certificate.

Can I generate self-signed client certificate and give it to the only client protected with password? and enable wcf to accept only that certificate?

I don't want my client to use certificate provided by some CA, instead I want to give it's system my own generated one.

EDIT :

As far as I've pointed, client certificates can be used for authentication because of Public/Private key architecture, Client has private key and encrypts data with it, server has it's public key and tries to decrypt data with it,( in RSA a data encrypted with private key can only decrypted with corresponding public key,) so if decryption succeeds server knows it was sent by particular client.

You can do that by configuring your service over two separate end points one secured (with certificate) and one without certificate. Check this post for general understanding (not specific to WCF) over Self signed certificate vs CA certificate - Self-signed SSL Cert or CA?

The complexity of this tutorial is one of the many examples that drove me away from WCF: http://msdn.microsoft.com/en-us/library/windowsazure/hh289316.aspx

Alternatively, you can setup something similar in other frameworks with much less code :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM