aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_ssl.erl
AgeCommit message (Collapse)Author
2020-04-20Delete local socket file when a listener closesjuhlig
2020-04-02Delete possibly existing socket file when listening on a local socketjuhlig
2019-10-14Enable multiple steps handshakejuhlig
Also fix some Protocol:start_link/4 into start_link/3 left over in the documentation.
2019-07-01Add missing specsjuhlig
2019-05-27Use transport options in ranch_transport:listen/1 callbacksjuhlig
The callback `ranch_transport:listen/1` has changed to accept a map of transport options instead of socket options.
2019-05-27Update ranch_ssl:ssl_opt() to conform with OTP 22 ssljuhlig
2019-05-18Add support for UNIX domain socketsjuhlig
It was working already but the types were wrong and some small details needed to be corrected.
2019-05-13Add the passive messages to ranch_transport:messages/0Loïc Hoguin
2019-05-09Use ssl:handshake instead of ssl:ssl_acceptLoïc Hoguin
This makes Ranch require OTP-21+. The function ranch:accept_ack/1 was also removed in this commit.
2019-05-06Fix some whitespaceLoïc Hoguin
2019-03-18Fix Dialyzer warning on unknown `ssl_cipher:erl_cipher_suite/0' typeGuilherme Andrade
* Up until OTP 21.0 it was defined on the ssl_cipher[0] module * On OTP 21.1 it was moved into ssl_cipher_format[1] * On OTP 21.3 it was moved into ssl[2] [0]: https://github.com/erlang/otp/blob/OTP-21.0/lib/ssl/src/ssl_cipher.erl#L56-L60 [1]: https://github.com/erlang/otp/blob/OTP-21.1/lib/ssl/src/ssl_cipher_format.erl#L40-L44 [2]: https://github.com/erlang/otp/blob/OTP-21.3/lib/ssl/src/ssl.erl#L136-L140
2018-10-23Add ranch:recv_proxy_header/2Loïc Hoguin
This is the function that should be called regardless of TCP or TLS being used. The proper usage for this function is: {ok, ProxyInfo} = ranch:recv_proxy_header(Ref, Timeout), {ok, Socket} = ranch:handshake(Ref), ... Ranch takes care of everything else under the hood. Transports now need to have a Transport:recv_proxy_header/2 function. For ranch_ssl the function gets the port from the sslsocket() record and then calls ranch_tcp:recv_proxy_header/2 with it. This means that two undocumented features are currently used for this, but the interface is really nice so that's a sacrifice worth doing. Also worth noting is that OTP 22 should have an alternative for gen_tcp:unrecv/2 so the only real issue is about the sslsocket() record at the moment.
2018-07-31Fix some whitespaceLoïc Hoguin
2018-07-04Return errors from Transport:handshakeLoïc Hoguin
The "normal" errors are still silenced when calling ranch:handshake.
2018-07-04Enable TLS upgrades via ranch_ssl:handshake/3Loïc Hoguin
Based on the work done by @juhlig.
2018-07-02Remove an old R16B01/02 workaroundLoïc Hoguin
Next release will only support 18+.
2018-07-02Introduce Transport:handshake/1,2j.uhlig
This commit deprecates Transport:accept_ack/1 in favor of a new forward-compatible function. Transport:handshake/1,2 will use ssl:handshake/2,3 from Ranch 2.0 onward.
2018-04-10Ranch 1.5.01.5.0Loïc Hoguin
2018-01-22Added transport functions getopts/2, getstat/1 and getstat/2Jan Uhlig
2017-06-07Update Copyright to 20171.4.0Loïc Hoguin
2016-11-24Update copyright yearLoïc Hoguin
2016-11-15Improve error reportingAlexey Lebedeff
Simplify some return values, improve error messages for eaddrinuse and no_cert. Amended to add tests and simpler code. Also hides the contents of cert and key transport options, if any.
2016-11-08Allow listening with only SNI optionsLoïc Hoguin
Cert/certfile is no longer required if SNI options are provided.
2016-11-08Blacklist listen options instead of whitelistLoïc Hoguin
Dialyzer will still complain about unknown options, but at least users won't be stuck waiting for an upstream update.
2016-11-01Add SSL options for legacy software interoperabilityAlexandru Munteanu
2016-10-09Make values for the TLS 1.2 signature_algorithms extension configurableVictor
Added in ssl-7.3.1 (OTP-13261). Documented in ssl-8.0.
2015-12-18Fix node shutdown getting stuckLoïc Hoguin
When SSL is stopped before Ranch, the acceptors crash and Ranch tries to restart them. The problem is that the ranch_ssl:listen/1 call was trying to start the SSL application to make sure it works (an old artifact from when releases were not ubiquitous). Because the application controller is trying to shutdown Ranch, and Ranch tries to tell it to start an application, everything would get stuck. To avoid a breaking change, we move this in the start_listener call (or child_spec). Note that there are still logs when the SSL application is closed, because the acceptors crash. But at least we don't block node shutdown anymore. In Ranch 2.0, we will implement the proper fix which is to simply depend on the SSL application normally. Nowadays, it's not too difficult to build a release that excludes applications we don't want, although we should document that in the Ranch user guide.
2015-08-18Welcome to 2015Loïc Hoguin
2015-08-18Update the list of allowed transport optionsLoïc Hoguin
We are now up to date with regard to transport options we should accept for the listening socket. Documentation of existing options has been updated with regard to recent changes in the OTP docs and type specifications.
2015-08-17Don't pass Ranch-specific options down to transportsLoïc Hoguin
Should fix Dialyzer issues. The options are now also documented in the Ranch module, and there's new ranch:opt(), ranch_tcp:opt() and ranch_ssl:opt() for use in third party code.
2014-11-02support ssl partial_chain featureAndre Graf
2014-09-11Merge branch 'add_transport_secure' of git://github.com/matrixise/ranchLoïc Hoguin
2014-09-11Merge branch 'ssl_closed' of git://github.com/yjh0502/ranchLoïc Hoguin
2014-09-11Don't report error on ssl {error, closed}Jihyun Yu
SSL socket might be closed on accept_ack, it happens quite often and it is not a problem, so don't report error on the case.
2014-09-02Add Transport:secure/0Stéphane Wirtel
Currently Ranch checks if a connection is secure by checking if its name is 'ssl'. This isn't a very modular solution, adding an API function that returns whether a connection is secure.
2014-06-10Update copyright yearsLoïc Hoguin
2014-04-30additional ssl option supportRansom Richardson
2014-04-23Ignore some errors that may occur during handshakeLoïc Hoguin
These errors just pollute the logs when garbage is sent to the socket. Exit the process normally to avoid unwanted logs.
2013-12-07Add Transport:shutdown/2Loïc Hoguin
Allows closing the socket in one or two directions.
2013-12-07Get rid of a ton of pointless commentsLoïc Hoguin
All of it can be found in the manual, which defines what the code must do, and is always up to date unlike the code comments.
2013-12-07Add transport options linger, send_timeout, send_timeout_closeLoïc Hoguin
2013-12-07Merge branch 'connect_timeout' of git://github.com/heroku/ranchLoïc Hoguin
2013-11-26Add accept_ack on all transports and ack_timeout transport optionLoïc Hoguin
Doing this in the connection process allows us to free acceptors to start accepting more connections quicker, especially under load.
2013-11-25Small fixes to specsLoïc Hoguin
2013-11-14Fix a socket leak with SSL when ssl_accept failsLoïc Hoguin
2013-11-07Implements ranch_transport:connect/4.Geoff Cant
Adds a transport connect method that takes a timeout, with implementations for both ssl and tcp connections.
2013-10-20Merge branch 'hibernate_after' of git://github.com/talko/ranchLoïc Hoguin
2013-09-23Add hibernate_after ssl optionRansom Richardson
2013-09-22Use previous ecc workaround for R16B02 as wellKlaus Trainer
The implementation of elliptic-curve ciphers that has been introduced in R16B01 is still incomplete (and broken). This makes our previous workaround (see c0c09a1311) work for R16B02 as well.
2013-08-16Add Transport:sendfile/4,/5James Fish
Adds offset based sendfile to transports. Same behaviour as file:sendfile/4,/5 except socket and file arguments are reversed and either a raw file or a filename can be used. sendfile/2,/4,/5 now compulsory callbacks in ranch_transport. ranch_tcp:sendfile/2 now defaults to a chunk_size of 8191 - the default for ranch_ssl:sendfile/2. The same default is used for both ranch_tcp:sendfile/4,5 and ranch_ssl:sendfile/4,5.