Mercurial > prosody-hg
annotate plugins/mod_net_multiplex.lua @ 13652:a08065207ef0
net.server_epoll: Call :shutdown() on TLS sockets when supported
Comment from Matthew:
This fixes a potential issue where the Prosody process gets blocked on sockets
waiting for them to close. Unlike non-TLS sockets, closing a TLS socket sends
layer 7 data, and this can cause problems for sockets which are in the process
of being cleaned up.
This depends on LuaSec changes which are not yet upstream.
From Martijn's original email:
So first my analysis of luasec. in ssl.c the socket is put into blocking
mode right before calling SSL_shutdown() inside meth_destroy(). My best
guess to why this is is because meth_destroy is linked to the __close
and __gc methods, which can't exactly be called multiple times and
luasec does want to make sure that a tls session is shutdown as clean
as possible.
I can't say I disagree with this reasoning and don't want to change this
behaviour. My solution to this without changing the current behaviour is
to introduce a shutdown() method. I am aware that this overlaps in a
conflicting way with tcp's shutdown method, but it stays close to the
OpenSSL name. This method calls SSL_shutdown() in the current
(non)blocking mode of the underlying socket and returns a boolean
whether or not the shutdown is completed (matching SSL_shutdown()'s 0
or 1 return values), and returns the familiar ssl_ioerror() strings on
error with a false for completion. This error can then be used to
determine if we have wantread/wantwrite to finalize things. Once
meth_shutdown() has been called once a shutdown flag will be set, which
indicates to meth_destroy() that the SSL_shutdown() has been handled
by the application and it shouldn't be needed to set the socket to
blocking mode. I've left the SSL_shutdown() call in the
LSEC_STATE_CONNECTED to prevent TOCTOU if the application reaches a
timeout for the shutdown code, which might allow SSL_shutdown() to
clean up anyway at the last possible moment.
Another thing I've changed to luasec is the call to socket_setblocking()
right before calling close(2) in socket_destroy() in usocket.c.
According to the latest POSIX[0]:
Note that the requirement for close() on a socket to block for up to
the current linger interval is not conditional on the O_NONBLOCK
setting.
Which I read to mean that removing O_NONBLOCK on the socket before close
doesn't impact the behaviour and only causes noise in system call
tracers. I didn't touch the windows bits of this, since I don't do
windows.
For the prosody side of things I've made the TLS shutdown bits resemble
interface:onwritable(), and put it under a combined guard of self._tls
and self.conn.shutdown. The self._tls bit is there to prevent getting
stuck on this condition, and self.conn.shutdown is there to prevent the
code being called by instances where the patched luasec isn't deployed.
The destroy() method can be called from various places and is read by
me as the "we give up" error path. To accommodate for these unexpected
entrypoints I've added a single call to self.conn:shutdown() to prevent
the socket being put into blocking mode. I have no expectations that
there is any other use here. Same as previous, the self.conn.shutdown
check is there to make sure it's not called on unpatched luasec
deployments and self._tls is there to make sure we don't call shutdown()
on tcp sockets.
I wouldn't recommend logging of the conn:shutdown() error inside
close(), since a lot of clients simply close the connection before
SSL_shutdown() is done.
| author | Martijn van Duren <martijn@openbsd.org> |
|---|---|
| date | Thu, 06 Feb 2025 15:04:38 +0000 |
| parents | 50324f66ca2a |
| children |
| rev | line source |
|---|---|
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 module:set_global(); |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 |
|
12977
74b9e05af71e
plugins: Prefix module imports with prosody namespace
Kim Alvefur <zash@zash.se>
parents:
11024
diff
changeset
|
3 local array = require "prosody.util.array"; |
|
13213
50324f66ca2a
plugins: Use integer config API with interval specification where sensible
Kim Alvefur <zash@zash.se>
parents:
12977
diff
changeset
|
4 local max_buffer_len = module:get_option_integer("multiplex_buffer_size", 1024, 1); |
|
50324f66ca2a
plugins: Use integer config API with interval specification where sensible
Kim Alvefur <zash@zash.se>
parents:
12977
diff
changeset
|
5 local default_mode = module:get_option_integer("network_default_read_size", 4096, 0); |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 |
|
12977
74b9e05af71e
plugins: Prefix module imports with prosody namespace
Kim Alvefur <zash@zash.se>
parents:
11024
diff
changeset
|
7 local portmanager = require "prosody.core.portmanager"; |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 local available_services = {}; |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
10 local service_by_protocol = {}; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
11 local available_protocols = array(); |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 local function add_service(service) |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 local multiplex_pattern = service.multiplex and service.multiplex.pattern; |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
15 local protocol_name = service.multiplex and service.multiplex.protocol; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
16 if protocol_name then |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
17 module:log("debug", "Adding multiplex service %q with protocol %q", service.name, protocol_name); |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
18 service_by_protocol[protocol_name] = service; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
19 available_protocols:push(protocol_name); |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
20 end |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 if multiplex_pattern then |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 module:log("debug", "Adding multiplex service %q with pattern %q", service.name, multiplex_pattern); |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 available_services[service] = multiplex_pattern; |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
24 elseif not protocol_name then |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 module:log("debug", "Service %q is not multiplex-capable", service.name); |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 module:hook("service-added", function (event) add_service(event.service); end); |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
29 module:hook("service-removed", function (event) |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
30 available_services[event.service] = nil; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
31 if event.service.multiplex and event.service.multiplex.protocol then |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
32 available_protocols:filter(function (p) return p ~= event.service.multiplex.protocol end); |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
33 service_by_protocol[event.service.multiplex.protocol] = nil; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
34 end |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
35 end); |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
36 |
|
9465
876171084ea3
mod_net_multiplex: Silence luacheck warnings
Kim Alvefur <zash@zash.se>
parents:
7807
diff
changeset
|
37 for _, services in pairs(portmanager.get_registered_services()) do |
|
7502
021d2b844c51
mod_net_multiplex: remove unused one-letter loop variable [luacheck]
Anton Shestakov <av6@dwimlabs.net>
parents:
6380
diff
changeset
|
38 for _, service in ipairs(services) do |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
39 add_service(service); |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
40 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
41 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
42 |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
43 local buffers = {}; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
44 |
|
11023
a59b37b03eca
mod_net_multiplex: Read no more than the max buffer size setting
Kim Alvefur <zash@zash.se>
parents:
10475
diff
changeset
|
45 local listener = { default_mode = max_buffer_len }; |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
46 |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
47 function listener.onconnect(conn) |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
48 local sock = conn:socket(); |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
49 if sock.getalpn then |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
50 local selected_proto = sock:getalpn(); |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
51 local service = service_by_protocol[selected_proto]; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
52 if service then |
|
10466
276f62d14437
mod_net_multiplex: Tweak debug logging for ALPN case
Kim Alvefur <zash@zash.se>
parents:
10465
diff
changeset
|
53 module:log("debug", "Routing incoming connection to %s based on ALPN %q", service.name, selected_proto); |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
54 local next_listener = service.listener; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
55 conn:setlistener(next_listener); |
|
11024
1c7602c70d1f
mod_net_multiplex: Set read size/mode to that of the target listener
Kim Alvefur <zash@zash.se>
parents:
11023
diff
changeset
|
56 conn:set_mode(next_listener.default_mode or default_mode); |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
57 local onconnect = next_listener.onconnect; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
58 if onconnect then return onconnect(conn) end |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
59 end |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
60 end |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
61 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
62 |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
63 function listener.onincoming(conn, data) |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
64 if not data then return; end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
65 local buf = buffers[conn]; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
66 buf = buf and buf..data or data; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
67 for service, multiplex_pattern in pairs(available_services) do |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
68 if buf:match(multiplex_pattern) then |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
69 module:log("debug", "Routing incoming connection to %s", service.name); |
|
9465
876171084ea3
mod_net_multiplex: Silence luacheck warnings
Kim Alvefur <zash@zash.se>
parents:
7807
diff
changeset
|
70 local next_listener = service.listener; |
|
876171084ea3
mod_net_multiplex: Silence luacheck warnings
Kim Alvefur <zash@zash.se>
parents:
7807
diff
changeset
|
71 conn:setlistener(next_listener); |
|
11024
1c7602c70d1f
mod_net_multiplex: Set read size/mode to that of the target listener
Kim Alvefur <zash@zash.se>
parents:
11023
diff
changeset
|
72 conn:set_mode(next_listener.default_mode or default_mode); |
|
9465
876171084ea3
mod_net_multiplex: Silence luacheck warnings
Kim Alvefur <zash@zash.se>
parents:
7807
diff
changeset
|
73 local onconnect = next_listener.onconnect; |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
74 if onconnect then onconnect(conn) end |
|
9465
876171084ea3
mod_net_multiplex: Silence luacheck warnings
Kim Alvefur <zash@zash.se>
parents:
7807
diff
changeset
|
75 return next_listener.onincoming(conn, buf); |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
76 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
77 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
78 if #buf > max_buffer_len then -- Give up |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
79 conn:close(); |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
80 else |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
81 buffers[conn] = buf; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
82 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
83 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
84 |
|
9465
876171084ea3
mod_net_multiplex: Silence luacheck warnings
Kim Alvefur <zash@zash.se>
parents:
7807
diff
changeset
|
85 function listener.ondisconnect(conn) |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
86 buffers[conn] = nil; -- warn if no buffer? |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
87 end |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
88 |
|
6380
4220ffb87b22
net.http, net.http.server, mod_c2s, mod_s2s, mod_component, mod_admin_telnet, mod_net_multiplex: Add ondetach to release connection from 'sessions' table (or equivalent)
Matthew Wild <mwild1@gmail.com>
parents:
5120
diff
changeset
|
89 listener.ondetach = listener.ondisconnect; |
|
4220ffb87b22
net.http, net.http.server, mod_c2s, mod_s2s, mod_component, mod_admin_telnet, mod_net_multiplex: Add ondetach to release connection from 'sessions' table (or equivalent)
Matthew Wild <mwild1@gmail.com>
parents:
5120
diff
changeset
|
90 |
|
5120
bcabea740c00
mod_{admin_telnet,c2s,component,http,net_multiplex,s2s}: Use module:provides() instead of module:add_item().
Waqas Hussain <waqas20@gmail.com>
parents:
4619
diff
changeset
|
91 module:provides("net", { |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
92 name = "multiplex"; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
93 config_prefix = ""; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
94 listener = listener; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
95 }); |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
96 |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
97 module:provides("net", { |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
98 name = "multiplex_ssl"; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
99 config_prefix = "ssl"; |
|
7806
00bca79ae778
mod_net_multiplex: Enable SSL on the SSL port (fixes #803)
Kim Alvefur <zash@zash.se>
parents:
6380
diff
changeset
|
100 encryption = "ssl"; |
|
10465
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
101 ssl_config = { |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
102 alpn = function () |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
103 return available_protocols; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
104 end; |
|
09697a673015
mod_net_multiplex: Add support for using ALPN
Kim Alvefur <zash@zash.se>
parents:
9465
diff
changeset
|
105 }; |
|
4619
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
106 listener = listener; |
|
d5739b8b7161
mod_net_multiplex: Port multiplexing (run multiple different services on a the same port(s))... now pluggable for use with any net plugin
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
107 }); |
