简体   繁体   中英

Enable SSL on WCF. What is required to be done on Client Side?

I want to enable SSL on WCF and what is required to be done on the WCF client side?

I found out that I can do as below.

BasicHttpBinding b = new BasicHttpBinding();
b.Security.Mode = BasicHttpSecurityMode.Transport ;
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows. 

But How about the client side? Thanks.

Edit: WCF is hosted on IIS and my wpf application will use this. Client will install this application on his/her PC.

Nothing is needed on the client side if the client is generated from WSDL exposed on your service. Otherwise you can use same binding configuration. The only needed thing is configuring a certificate. If you don't have a certificate for HTTPS issued by authority which your clients trust to you must distribute the certificate and install it to Trusted People certificate store on your clients. Also be aware that clients must be part of your network domain when using Windows integrated authentication.

As far as the client is concerned, it must follow the same WCF ABC's as the server. The Address, Binding and Contract must all match in order for the client to talk to the service. As Ladislav has said, further configuration will be required on the server for the SSL cert. Nothing else should be required for the client assuming that the client will be able to validate the chain of trust on the certificate.

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