[erlang-questions] httpc:request fails on some sites

Ilya Khaprov ilya.khaprov@REDACTED
Tue Sep 20 19:41:55 CEST 2016


Hi Michael,

You can force TLS version here:

httpc:request(get, {"https://api.datamarket.azure.com", []}, [{ssl, [{versions, ['tlsv1']}]}, {autoredirect, false}], []).

Ilya

> From: michael@REDACTED
> Date: Tue, 20 Sep 2016 10:29:34 -0700
> To: erlang-questions@REDACTED
> Subject: [erlang-questions] httpc:request fails on some sites
> 
> Hi there,
> 
> Does anyone here know the likely reason the last line is failing?
> 
> ~$ curl https://api.datamarket.azure.com
> <html><head><title>Object moved</title></head><body>
> <h2>Object moved to <a href="https://datamarket.azure.com">here</a>.</h2>
> </body></html>
> ~$ erl
> Erlang/OTP 19 [erts-8.0.2] [source-753b9b9] [64-bit] [smp:2:2]
> [async-threads:10] [hipe] [kernel-poll:false]
> 
> Eshell V8.0.2  (abort with ^G)
> 1> inets:start().
> ok
> 2> ssl:start().
> ok
> 3> httpc:request("https://www.google.com").
> {ok,{{"HTTP/1.1",200,"OK"}, ...truncated...
> 4> httpc:request("https://api.datamarket.azure.com").
> {error,{failed_connect,[{to_address,{"api.datamarket.azure.com",
>                                      443}},
>                         {inet,[inet],closed}]}}
> 
> https://gist.github.com/formido/db472011f2dd3f47a99b66bd8784ee55
> 
> Cheers,
> Mike
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160920/5f86e160/attachment.htm>


More information about the erlang-questions mailing list