Skip to content

Commit 0994297

Browse files
committed
Custom SSL params
Instead of preset SSL parameters you provide your own (required), look at LuaSec for information on parameters
1 parent a3fdc4e commit 0994297

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/websocket/sync.lua

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ local close = function(self,code,reason)
118118
return was_clean,code,reason or ''
119119
end
120120

121-
local connect = function(self,ws_url,ws_protocol)
121+
local connect = function(self,ws_url,ws_protocol,ssl_params)
122122
if self.state ~= 'CLOSED' then
123123
return nil,'wrong state'
124124
end
@@ -129,13 +129,7 @@ local connect = function(self,ws_url,ws_protocol)
129129
return nil,err
130130
end
131131
if protocol == 'wss' then
132-
local params = {
133-
mode = "client",
134-
protocol = "sslv23",
135-
verify = "none",
136-
options = {"all"}
137-
}
138-
self.sock = ssl.wrap(self.sock, params)
132+
self.sock = ssl.wrap(self.sock, ssl_params)
139133
self.sock:dohandshake()
140134
elseif protocol ~= "ws" then
141135
return nil, 'bad protocol'

0 commit comments

Comments
 (0)