From 93c88fdc541c3f8a4ebbae3699bee90d00dc637f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 4 Jun 2018 08:40:31 +0200 Subject: Remove the dependency on Ranch We instead of two new modules, gun_tcp and gun_tls. They only have 6 functions so far, much less than what Ranch provided before. Also renames ssl to tls where applicable. It's still possible to use the ssl transport option but it's now undocumented. --- doc/src/guide/connect.asciidoc | 8 ++++---- doc/src/guide/start.asciidoc | 2 +- doc/src/manual/gun.asciidoc | 12 ++++++------ doc/src/manual/gun_app.asciidoc | 1 - 4 files changed, 11 insertions(+), 12 deletions(-) (limited to 'doc') diff --git a/doc/src/guide/connect.asciidoc b/doc/src/guide/connect.asciidoc index e0b09d6..f7983bc 100644 --- a/doc/src/guide/connect.asciidoc +++ b/doc/src/guide/connect.asciidoc @@ -34,9 +34,9 @@ The `gun:open/{2,3}` function must be used to open a connection. {ok, ConnPid} = gun:open("example.org", 443). If the port given is 443, Gun will attempt to connect using -SSL. The protocol will be selected automatically using the +TLS. The protocol will be selected automatically using the ALPN extension for TLS. By default Gun supports HTTP/2 -and HTTP/1.1 when connecting using SSL. +and HTTP/1.1 when connecting using TLS. For any other port, Gun will attempt to connect using TCP and will use the HTTP/1.1 protocol. @@ -47,10 +47,10 @@ options. The manual documents all available options. Options can be provided as a third argument, and take the form of a map. -.Opening an SSL connection to example.org on port 8443 +.Opening a TLS connection to example.org on port 8443 [source,erlang] -{ok, ConnPid} = gun:open("example.org", 8443, #{transport=>ssl}). +{ok, ConnPid} = gun:open("example.org", 8443, #{transport => tls}). === Waiting for the connection to be established diff --git a/doc/src/guide/start.asciidoc b/doc/src/guide/start.asciidoc index 6d93e2e..17cbe87 100644 --- a/doc/src/guide/start.asciidoc +++ b/doc/src/guide/start.asciidoc @@ -27,7 +27,7 @@ use it. [source,erlang] ---- 1> application:ensure_all_started(gun). -{ok,[ranch,crypto,cowlib,asn1,public_key,ssl,gun]} +{ok,[crypto,cowlib,asn1,public_key,ssl,gun]} ---- === Stopping diff --git a/doc/src/manual/gun.asciidoc b/doc/src/manual/gun.asciidoc index b5ed039..b15ce09 100644 --- a/doc/src/manual/gun.asciidoc +++ b/doc/src/manual/gun.asciidoc @@ -149,7 +149,7 @@ opts() :: #{ retry => non_neg_integer(), retry_timeout => pos_integer(), trace => boolean(), - transport => tcp | ssl, + transport => tcp | tls, transport_opts => [gen_tcp:connect_option()] | [ssl:connect_option()], ws_opts => ws_opts() } @@ -175,11 +175,11 @@ protocols - see below:: Ordered list of preferred protocols. When the transport is `tcp`, this list must contain exactly one protocol. When the transport -is `ssl`, this list must contain at least one protocol and will be +is `tls`, this list must contain at least one protocol and will be used to negotiate a protocol via ALPN. When the server does not support ALPN then `http` will always be used. Defaults to `[http]` when the transport is `tcp`, and `[http2, http]` when the -transport is `ssl`. +transport is `tls`. retry (5):: @@ -196,12 +196,12 @@ only be used during debugging. transport - see below:: -Whether to use SSL or plain TCP. The default varies depending on the -port used. Port 443 defaults to `ssl`. All other ports default to `tcp`. +Whether to use TLS or plain TCP. The default varies depending on the +port used. Port 443 defaults to `tls`. All other ports default to `tcp`. transport_opts ([]):: -Transport options. They are TCP options or SSL options depending on +Transport options. They are TCP options or TLS options depending on the selected transport. ws_opts (#{}):: diff --git a/doc/src/manual/gun_app.asciidoc b/doc/src/manual/gun_app.asciidoc index 606d9fb..c369095 100644 --- a/doc/src/manual/gun_app.asciidoc +++ b/doc/src/manual/gun_app.asciidoc @@ -19,7 +19,6 @@ to the server and reconnects automatically when necessary. == Dependencies -// @todo I do not want a dependency on Ranch, remove it * link:man:cowlib(7)[cowlib(7)] - Support library for manipulating Web protocols * ssl - Secure communication over sockets -- cgit v1.2.3