Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does WCF + SSL working with load balancing?

If SSL is handled by a load balancer, do I still need to configure it in the WCF serviceCertificate node? My scenario is to use message level security. If someone can explain how load balancing with wcf and ssl works, that would be very nice.

like image 554
Xaisoft Avatar asked Jun 01 '11 19:06

Xaisoft


People also ask

How does SSL work with a load balancer?

The load balancer uses the certificate to terminate the connection and then decrypt requests from clients before sending them to the instances. The SSL and TLS protocols use an X. 509 certificate (SSL/TLS server certificate) to authenticate both the client and the back-end application.

Does load balancer require SSL certificate?

To achieve this, the load balancer must have an SSL certificate and the certificate's corresponding private key. Communication between the client and the load balancer remains private—illegible to any third party that doesn't have this private key.

How does server load balancing work?

A load balancer acts as the “traffic cop” sitting in front of your servers and routing client requests across all servers capable of fulfilling those requests in a manner that maximizes speed and capacity utilization and ensures that no one server is overworked, which could degrade performance.

Can Web server do load balancing?

Server load balancing is a way for servers to effectively handle high-volume traffic and avoid decreased load times and accessibility problems. By properly and evenly distributing network and web traffic to more than one server, organizations can improve throughput and application response times.


2 Answers

WCF requires security tokens to be passed over a secure transport if the message itself is not signed/encrypted. Since traffic is HTTP between your Big-IP and your individual web servers, you need a way to have security tokens that you know are secured between the client and the Big-IP up front still be passed to your server farm. There's a couple ways to do that depending on what version of WCF you're using:

If you're using WCF 4.0 you can just create a custom binding and set the AllowInsecureTransport property on the built in SecurityBindingElement to signify that you don't care that the transport isn't secure.

If you're using WCF 3.5 you have to "lie" about security with a custom TransportSecurityBindingElement on the server side. You can read my old post about this here.

FWIW, they created a hotfix release for 3.5 SP1 that adds the AllowInsecureTransport to that version, but I don't know if your company will allow you to install custom hotfixes.

like image 183
Drew Marsh Avatar answered Nov 15 '22 08:11

Drew Marsh


If you want to use message security then each message is encrypted and signed separately - there is no secure connection and load balancer behaves as with any other HTTP transport. Loadbalancer doesn't know about security and doesn't need certificate.

There are two gotchas:

  • All load balanced application servers hosting your WCF service must use the same certificate
  • You must ensure that your WCF binding doesn't use sessions (reliable, security) otherwise you will need load balancing algorithm with sticky sessions (all request for single session always routed to the same server)
like image 27
Ladislav Mrnka Avatar answered Nov 15 '22 06:11

Ladislav Mrnka