title: Node.js TLS request with specific ciphers
body: <p>I have a Node.js app that needs to check the TLS compatibility of external resources.  I need to limit the specific ciphers that Node.js will use when making an external TLS request.  I'm looking for sample code to achieve this.</p>
  
  <p>More info: Apple is requiring in iOS 9 <a href="https://developer.apple.com/library/prerelease/mac/technotes/App-Transport-Security-Technote/index.html" rel="noreferrer">all outbound connections be encrypted</a> and the allowed cipher list is limited.</p>
  
  <p>The accepted ciphers are:</p>
  
  <pre><code>TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
  TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
  TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
  TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
  TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
  TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  </code></pre>
  
  <p>My goal is to build a service that will check to make sure external servers meet the Apple requirements.</p>