@@ -5,7 +5,6 @@ local ssl = require'ssl'
5
5
local tinsert = table.insert
6
6
local tconcat = table.concat
7
7
8
-
9
8
local receive = function (self )
10
9
if self .state ~= ' OPEN' and not self .is_closing then
11
10
return nil ,nil ,false ,1006 ,' wrong state'
@@ -118,7 +117,7 @@ local close = function(self,code,reason)
118
117
return was_clean ,code ,reason or ' '
119
118
end
120
119
121
- local connect = function (self ,ws_url ,ws_protocol )
120
+ local connect = function (self ,ws_url ,ssl_params , ws_protocol )
122
121
if self .state ~= ' CLOSED' then
123
122
return nil ,' wrong state'
124
123
end
@@ -129,13 +128,7 @@ local connect = function(self,ws_url,ws_protocol)
129
128
return nil ,err
130
129
end
131
130
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 )
131
+ self .sock = ssl .wrap (self .sock , ssl_params )
139
132
self .sock :dohandshake ()
140
133
elseif protocol ~= " ws" then
141
134
return nil , ' bad protocol'
0 commit comments