Skip to content

Instantly share code, notes, and snippets.

View gkatev's full-sized avatar

George Katevenis gkatev

  • CARV, ICS FORTH
View GitHub Profile
@gkatev
gkatev / ssl_c_pem.lua
Last active September 22, 2021 20:31 — forked from bzed/ssl_c_pem.lua
haproxy pem formatted ssl client cert fetch - ssl_c_pem & ssl_c_pem_escaped - like ssl_c_der
local basexx = require("basexx")
core.register_fetches("ssl_c_pem", function(txn)
local der = txn.f:ssl_c_der()
if not der then return "" end
local envelope = "-----BEGIN %s-----\n%s\n-----END %s-----"
local typ = "CERTIFICATE";
local wrap = ('.'):rep(64)