title: Using specific cipher for SSL/TLS in boost::asio
body: <p>I am implementing a mutual authentication where the server is using nodejs while client is using <code>boost::asio</code>. I was trying to work around by putting specific cipher and specific TLS version. I can force it to use the specific tls version, but how can I force boost::asio to work with specific ciphers. Here is my implementation code:</p>
  
  <pre><code>context_ptr ctx = websocketpp::lib::make_shared&lt;boost::asio::ssl::context&gt;(websocketpp::lib::asio::ssl::context::tlsv12_client);
  try {
          ctx-&gt;set_options(boost::asio::ssl::context::default_workarounds |
                           boost::asio::ssl::context::no_sslv2 |
                           boost::asio::ssl::context::single_dh_use);
          ctx-&gt;set_verify_mode(boost::asio::ssl::context::verify_peer | 
          boost::asio::ssl::context::verify_fail_if_no_peer_cert);
          ctx-&gt;load_verify_file("ca_server.pem");
      } catch (std::exception&amp; e) {
          std::cout &lt;&lt; "Exception " &lt;&lt; e.what() &lt;&lt; std::endl;
      }
  SSL_set_cipher_list(ctx-&gt;native_handle(), "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384");
  ctx-&gt;use_certificate_file("client.pem",
          boost::asio::ssl::context::file_format::pem);
  ctx-&gt;use_private_key_file("client.key", 
          boost::asio::ssl::context::file_format::pem);
  </code></pre>
  
  <p>As you can see I want to use <code>TLS_DHE_RSA_WITH_AES_256_GCM_SHA384</code> cipher as authentication. Can anyone tell me what I should do to force it to use the specific cipher?</p>
  
  <p>Note: My implementation of <code>SSL_set_cipher_list(ctx-&gt;native_handle(), "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384");</code> is wrong. So how can I make this work?</p>