Software /
code /
prosody-modules
Comparison
mod_client_certs/mod_client_certs.lua @ 712:227d48f927ff
mod_client_certs: Strip x509 data
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Tue, 12 Jun 2012 14:00:57 +0200 |
parent | 709:151743149f07 |
child | 713:88ef66a65b13 |
comparison
equal
deleted
inserted
replaced
711:53afd87f3612 | 712:227d48f927ff |
---|---|
104 origin.send(st.error_reply(stanza, "cancel", "bad-request", "No certificate found.")); | 104 origin.send(st.error_reply(stanza, "cancel", "bad-request", "No certificate found.")); |
105 return true | 105 return true |
106 end | 106 end |
107 | 107 |
108 local can_manage = key_info:get_child("no-cert-management", xmlns_saslcert) ~= nil; | 108 local can_manage = key_info:get_child("no-cert-management", xmlns_saslcert) ~= nil; |
109 local x509cert = key_info:get_child_text("x509cert"); | 109 local x509cert = key_info:get_child_text("x509cert"):gsub("^%s*(.-)%s*$", "%1"); |
110 | 110 |
111 local cert = x509.cert_from_pem( | 111 local cert = x509.cert_from_pem( |
112 "-----BEGIN CERTIFICATE-----\n" | 112 "-----BEGIN CERTIFICATE-----\n" |
113 .. x509cert .. | 113 .. x509cert .. |
114 "\n-----END CERTIFICATE-----\n"); | 114 "\n-----END CERTIFICATE-----\n"); |