aboutsummaryrefslogtreecommitdiffstats
path: root/util/openssl.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-05-01 13:45:42 +0100
committerMatthew Wild <mwild1@gmail.com>2013-05-01 13:45:42 +0100
commit1bf9350814aea431d58dce6942ce9a744740e621 (patch)
tree3e00cd2af58e4602779b13c51761bd86b48ea264 /util/openssl.lua
parent201ccbe3b55104da18c030c22b1b8f897fa13710 (diff)
parentf10d012d24cf65e24ba0ff176b56613f4ae4f532 (diff)
downloadprosody-1bf9350814aea431d58dce6942ce9a744740e621.tar.gz
prosody-1bf9350814aea431d58dce6942ce9a744740e621.zip
Merge 0.9->trunk
Diffstat (limited to 'util/openssl.lua')
-rw-r--r--util/openssl.lua22
1 files changed, 21 insertions, 1 deletions
diff --git a/util/openssl.lua b/util/openssl.lua
index 0decb579..ef3fba96 100644
--- a/util/openssl.lua
+++ b/util/openssl.lua
@@ -23,11 +23,12 @@ function config.new()
prompt = "no",
},
distinguished_name = {
- commonName = "example.com",
countryName = "GB",
+ -- stateOrProvinceName = "",
localityName = "The Internet",
organizationName = "Your Organisation",
organizationalUnitName = "XMPP Department",
+ commonName = "example.com",
emailAddress = "xmpp@example.com",
},
v3_extensions = {
@@ -43,6 +44,17 @@ function config.new()
}, ssl_config_mt);
end
+local DN_order = {
+ "countryName";
+ "stateOrProvinceName";
+ "localityName";
+ "streetAddress";
+ "organizationName";
+ "organizationalUnitName";
+ "commonName";
+ "emailAddress";
+}
+_M._DN_order = DN_order;
function ssl_config:serialize()
local s = "";
for k, t in pairs(self) do
@@ -53,6 +65,14 @@ function ssl_config:serialize()
s = s .. s_format("%s.%d = %s\n", san, i -1, n[i]);
end
end
+ elseif k == "distinguished_name" then
+ for i=1,#DN_order do
+ local k = DN_order[i]
+ local v = t[k];
+ if v then
+ s = s .. ("%s = %s\n"):format(k, v);
+ end
+ end
else
for k, v in pairs(t) do
s = s .. ("%s = %s\n"):format(k, v);