title: CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any
body: <p>I've had issues with CasperJS and SSL, but using --ssl-protocol=any has always fixed the problem, as referenced in <a href="https://stackoverflow.com/questions/26415188/casperjs-phantomjs-doesnt-load-https-page">this</a> answer. In this case, I'm still having issues.</p>
  
  <p>I put this in the command line:</p>
  
  <pre><code>casperjs --ssl-protocol=any --ignore-ssl-errors=true sanity.js
  </code></pre>
  
  <p>This is sanity.js:</p>
  
  <pre><code> var casper = require('casper').create({
      verbose: true,
      logLevel: 'debug'
  });
  
  casper.on("resource.error", function(resourceError){
      console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')');
      console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);
  });
  
  casper.start('https://www.google.com/', function() {
      this.echo(this.getTitle());
  });
  
  casper.thenOpen('https://www.zazzle.com/lgn/signin', function() {
      this.echo(this.getTitle());
  });
  
  casper.run();
  </code></pre>
  
  <p>The first URL loads fine. But then the SSL handshake fails in the second one. Debug output:</p>
  
  <pre><code>[info] [phantom] Starting...
  [info] [phantom] Running suite: 4 steps
  [debug] [phantom] opening url: https://www.google.com/, HTTP GET
  [debug] [phantom] Navigation requested: url=https://www.google.com/, type=Other, willNavigate=true, isMainFrame=true
  [debug] [phantom] url changed to "https://www.google.com/"
  [debug] [phantom] Successfully injected Casper client-side utilities
  [info] [phantom] Step anonymous 2/4 https://www.google.com/ (HTTP 200)
  Google
  [info] [phantom] Step anonymous 2/4: done in 876ms.
  [debug] [phantom] opening url: https://www.zazzle.com/lgn/signin, HTTP GET
  [debug] [phantom] Navigation requested: url=https://www.zazzle.com/lgn/signin, type=Other, willNavigate=true, isMainFrame=true
  Unable to load resource (#9URL:https://www.zazzle.com/lgn/signin)
  Error code: 6. Description: SSL handshake failed
  [warning] [phantom] Loading resource failed with status=fail: https://www.zazzle.com/lgn/signin
  [info] [phantom] Step anonymous 4/4 https://www.google.com/ (HTTP 0)
  Google
  [info] [phantom] Step anonymous 4/4: done in 1178ms.
  [info] [phantom] Done 4 steps in 1197ms
  </code></pre>
  
  <p>I'm running PhantomJS version 1.9.7 and CasperJS version 1.1.0-beta3. I'm a bit clueless when it comes to the finer points of SSL, but I'm having trouble finding any more ways to fix this. Any help would be awesome!</p>