Skip to content

Commit ff9c8f1

Browse files
committed
refactor: omit PROTOCOL prefix in ngx.ssl
1 parent 8c9cfa9 commit ff9c8f1

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

lib/ngx/ssl.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,12 @@ function _M.set_priv_key(priv_key)
275275
end
276276

277277

278-
_M.PROTOCOL_SSLv2 = 0x0002
279-
_M.PROTOCOL_SSLv3 = 0x0004
280-
_M.PROTOCOL_TLSv1 = 0x0008
281-
_M.PROTOCOL_TLSv1_1 = 0x0010
282-
_M.PROTOCOL_TLSv1_2 = 0x0020
283-
local default_protocols = bor(_M.PROTOCOL_SSLv3, _M.PROTOCOL_TLSv1,
284-
_M.PROTOCOL_TLSv1_1, _M.PROTOCOL_TLSv1_2)
278+
_M.SSLv2 = 0x0002
279+
_M.SSLv3 = 0x0004
280+
_M.TLSv1 = 0x0008
281+
_M.TLSv1_1 = 0x0010
282+
_M.TLSv1_2 = 0x0020
283+
local default_protocols = bor(_M.SSLv3, _M.TLSv1, _M.TLSv1_1, _M.TLSv1_2)
285284

286285

287286
function _M.create_ctx(options)

t/ssl-ctx.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ no options found
242242
local bit = require "bit"
243243
local bor = bit.bor
244244
245-
ngx.say(test_ssl_protocol(ssl.PROTOCOL_TLSv1))
246-
ngx.say(test_ssl_protocol(ssl.PROTOCOL_TLSv1_1))
247-
ngx.say(test_ssl_protocol(ssl.PROTOCOL_TLSv1_2))
248-
ngx.say(test_ssl_protocol(bor(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1_2)))
245+
ngx.say(test_ssl_protocol(ssl.TLSv1))
246+
ngx.say(test_ssl_protocol(ssl.TLSv1_1))
247+
ngx.say(test_ssl_protocol(ssl.TLSv1_2))
248+
ngx.say(test_ssl_protocol(bor(ssl.SSLv2, ssl.TLSv1_2)))
249249
}
250250
}
251251

0 commit comments

Comments
 (0)