playframework/playframework — pull request #3393 by wsargent (2014-09-10 16:17:49+00:00)
Title: Fix example so it is clear the secure defaults should always be used.

From https://groups.google.com/d/topic/play-framework/NCCcbA-gkUY/discussion, it's clear that using

```
val builder = new (com.ning.http.client.AsyncHttpClientConfig.Builder)()
implicit val sslClient = new play.api.libs.ws.ning.NingWSClient(builder.build())
```

is a bad practice, as AsyncHttpClient 1.8.x doesn't do any hostname verification out of the box.

Added a note to ScalaWS and added this revised example:

```
//#implicit-client
val clientConfig = new DefaultWSClientConfig()
val secureDefaults:com.ning.http.client.AsyncHttpClientConfig = new NingAsyncHttpClientConfigBuilder(clientConfig).build()
// You can directly use the builder for specific options once you have secure TLS defaults...
val builder = new com.ning.http.client.AsyncHttpClientConfig.Builder(secureDefaults)
builder.setCompressionEnabled(true)
val secureDefaultsWithSpecificOptions:com.ning.http.client.AsyncHttpClientConfig = builder.build()
implicit val implicitClient = new play.api.libs.ws.ning.NingWSClient(secureDefaultsWithSpecificOptions)
val response = WS.clientUrl(url).get()
//#implicit-client
```

Fixed example in 2.3.x, needs to be forward ported to master.