Silverlight can without any problem talk to HTTP or HTTPS.
So if you do not know where will be deployed you’ll need to make sure your application will work well in both scenarios.
All your web services will need two configuration on the binding of the protocol.
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_SilverlightWebService" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
<binding name="BasicHttpBinding_SilverlightWebServiceSSL" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
One for not security (None) and the other for SSL (Transport)
Second, you’ll have to create a class inheriting from the base proxy class of the service.
public class SilverlightWebServiceProxy : SLService.SilverlightWebServiceClient
Then detect if is in https and use the correct security model.
base.Endpoint.Contract.Name = base.Endpoint.Contract.Name + "SSL";
This is simple, yet you need to make sure all the resources that you accessed in HTTP are accessible in HTTPS.
Please make sure to use the correct clientaccesspolicy.xml that explicitly says that https is ok to access the resources, otherwise Silverlight will failed.
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="SOAPAction">
<domain uri="http://*" />
<domain uri="https://*" />
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Hope this helps
Cheers
Al