Skip to content

Instantly share code, notes, and snippets.

@andreionut
Created March 10, 2015 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreionut/03a20fb52e8666136f93 to your computer and use it in GitHub Desktop.
Save andreionut/03a20fb52e8666136f93 to your computer and use it in GitHub Desktop.
Elixir 1.0.2 Code:
iex(1)> :inets.start
:ok
iex(2)> :ssl.start
:ok
iex(3)> :ssl.connect("gateway.sandbox.push.apple.com", 2195, [{:mode, :binary}, {:certfile, "/path_to_cert.pem"}], 30000)
{:error, {:options, {:socket_options, [mode: :binary]}}}
iex(5)> :ssl.connect("api.github.com", 443, [], 30000)
{:error, {:options, {:socket_options, []}}}
iex(7)> :ssl.connect("api.github.com", 443, [mode: :binary], 30000)
{:error, {:options, {:socket_options, [mode: :binary]}}}
Erlang 17.4 (same on 17.0 and 17.1)
1> application:start(crypto), application:start(asn1), application:start(public_key), application:start(ssl).
ok
2> ssl:connect("gateway.sandbox.push.apple.com", 2195, [{mode, binary}, {certfile, "/path_to_cert.pem"}], 30000).
{ok,{sslsocket,{gen_tcp,#Port<0.1215>,tls_connection,
undefined},
<0.51.0>}}
3> ssl:connect("api.github.com", 443, [{mode, binary}], 30000).
{ok,{sslsocket,{gen_tcp,#Port<0.903>,tls_connection,
undefined},
<0.48.0>}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment