diff --git a/README.md b/README.md index 93da685..7ed282a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,25 @@ end ## Examples +### :ssl + +```elixir +iex -S mix +Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns] + +Interactive Elixir (1.15.4) - press Ctrl+C to exit (type h() ENTER for help) +iex(1)> :ssl.connect('www.google.com', 443, []) +{:error, {:options, :incompatible, [verify: :verify_peer, cacerts: :undefined]}} +iex(2)> :ssl.connect('www.google.com', 443, ExSslOptions.eef_options) +{:ok, + {:sslsocket, {:gen_tcp, #Port<0.4>, :tls_connection, :undefined}, + [#PID<0.193.0>, #PID<0.192.0>]}} +iex(3)> :ssl.connect('www.google.com', 443, ExSslOptions.basic_options) +{:ok, + {:sslsocket, {:gen_tcp, #Port<0.5>, :tls_connection, :undefined}, + [#PID<0.198.0>, #PID<0.197.0>]}} +``` + ### :httpc Without `ExSslOptions`, we get a warning message: