Created
March 8, 2016 08:13
-
-
Save luciferous/8f98fd3367af7d2aa7ef to your computer and use it in GitHub Desktop.
Revisions
-
luciferous created this gist
Mar 8, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ import com.twitter.finagle.Http import com.twitter.finagle.http.{Http => _, _} import com.twitter.io.{Buf, Reader} import com.twitter.util.Await val tls = Http.client.withStreaming(enabled=true).withTlsWithoutValidation.newService("localhost:4433") val plain = Http.client.withStreaming(enabled=true).newService("localhost:3000") val tlsReq = Request(Version.Http11, Method.Get, "/", Reader.writable()) val tlsRes = Await.result(tls(tlsReq).liftToTry) println("TLS response failed? " + tlsRes.isThrow) val plainReq = Request(Version.Http11, Method.Get, "/", Reader.writable()) val plainRes = Await.result(plain(plainReq).liftToTry) println("TLS response failed? " + plainRes.isThrow) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ while true; do printf 'HTTP/1.1 200 OK\r\nServer: test\r\n'|nc -l 3000; done This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ while true; do printf 'HTTP/1.1 200 OK\r\nServer: test\r\n'|openssl s_server; done