title: How do I force ScriptManager to serve CDN scripts over SSL
body: <p>We have a site served on a web farm.  The farm is behind an SSL Accellerator which handles the encryption.  This means that our IIS servers see all incoming connections as http, even though users all connect to the site via https.</p>
  
  <p>We are beginning to use the EnableCDN=true property of ScriptManager.  While on our dev environments where there is no SSL Accellerator the references to the js files on the CDN are rendered with https, on the production environment they are rendered insecurely over http which is causing the js to be blocked with "Only secure content is displayed" errors.</p>
  
  <p>Short of manually updating all the script references in scriptmanager or re-writing the HTML on the way out via a module, does anyone know of a way to force the scriptmanager to render its references via https?</p>
  
  <p>EDIT:</p>
  
  <p>After doing some reflector review, I don't believe this is possible.  I've put the following hack into place, however this is obviously fragile as it involves accessing a private field.  If anyone can see a better way I would love to hear it.</p>
  
  <pre><code>var secureConnectionField = ScriptManager.GetType().GetField("_isSecureConnection", BindingFlags.Instance | BindingFlags.NonPublic);
  if (secureConnectionField != null)
      secureConnectionField.SetValue(ScriptManager, true);
  </code></pre>