Check if PSK is available

This commit is contained in:
Bruno Silvestre 2023-03-19 11:48:56 -03:00
parent e01c6e63cd
commit 6405645155
2 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,11 @@
local socket = require("socket") local socket = require("socket")
local ssl = require("ssl") local ssl = require("ssl")
if not ssl.config.capabilities.psk then
print("[ERRO] PSK not available")
os.exit(1)
end
-- @param hint (nil | string) -- @param hint (nil | string)
-- @param max_identity_len (number) -- @param max_identity_len (number)
-- @param max_psk_len (number) -- @param max_psk_len (number)

View File

@ -4,6 +4,11 @@
local socket = require("socket") local socket = require("socket")
local ssl = require("ssl") local ssl = require("ssl")
if not ssl.config.capabilities.psk then
print("[ERRO] PSK not available")
os.exit(1)
end
-- @param identity (string) -- @param identity (string)
-- @param max_psk_len (number) -- @param max_psk_len (number)
-- @return psk (string) -- @return psk (string)