Created
March 15, 2017 15:25
-
-
Save kkazuo/e809bd63c887052550c1dc7fd7794d28 to your computer and use it in GitHub Desktop.
cohttp with async_ssl : If you get SSL handshake error, specify version of ssl_config
This file contains 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 characters
open Core.Std | |
open Async.Std | |
module Http = Cohttp_async | |
let ssl_config = | |
Conduit_async.Ssl.configure ~version:Tlsv1_2 () | |
let main key () = | |
Http.Client.get Uri.(of_string key) ~ssl_config >>= fun (res, body) -> | |
Http.Body.drain body >>= fun () -> | |
print_endline "ok!"; | |
return () | |
let () = | |
Command.async | |
~summary:"https clint test" | |
Command.Spec.( | |
empty | |
+> anon ("host" %: string) | |
) | |
main | |
|> Command.run |
This file contains 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 characters
(executables | |
((names (cohttp_ssl_version)) | |
(libraries (async_ssl cohttp.async)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment