prosodyctl: Fix for generating certs with UTF-8
authorKim Alvefur <zash@zash.se>
Mon, 14 May 2012 16:04:32 +0000 (18:04 +0200)
committerKim Alvefur <zash@zash.se>
Mon, 14 May 2012 16:04:32 +0000 (18:04 +0200)
prosodyctl

index 6e112ccf58356b24d456189d75a628ff2712a322..1819ddd1a45bc7facf7befb82e1e5f96bfaf13b6 100755 (executable)
@@ -640,6 +640,9 @@ function cert_commands.config(arg)
                        end
                        nv = show_prompt(("%s (%s):"):format(k, nv or v));
                        nv = (not nv or nv == "") and v or nv;
+                       if nv:find"[\192-\252][\128-\191]+" then
+                               conf.req.string_mask = "utf8only"
+                       end
                        conf.distinguished_name[k] = nv ~= "." and nv or nil;
                end
                local conf_file = io.open(conf_filename, "w");