Comparison

prosodyctl @ 6035:1b5ca55bf895

prosodyctl: Show real error if certificate config file can't be opened
author Kim Alvefur <zash@zash.se>
date Sat, 22 Mar 2014 12:02:11 +0100
parent 5547:f306daf2bf6d
child 6038:b3ceb7627e27
child 6324:c9730926002b
comparison
equal deleted inserted replaced
6034:ee14da71d3fc 6035:1b5ca55bf895
682 conf.req.string_mask = "utf8only" 682 conf.req.string_mask = "utf8only"
683 end 683 end
684 conf.distinguished_name[k] = nv ~= "." and nv or nil; 684 conf.distinguished_name[k] = nv ~= "." and nv or nil;
685 end 685 end
686 end 686 end
687 local conf_file = io.open(conf_filename, "w"); 687 local conf_file, err = io.open(conf_filename, "w");
688 if not conf_file then
689 show_warning("Could not open OpenSSL config file for writing");
690 show_warning(err);
691 os.exit(1);
692 end
688 conf_file:write(conf:serialize()); 693 conf_file:write(conf:serialize());
689 conf_file:close(); 694 conf_file:close();
690 print(""); 695 print("");
691 show_message("Config written to " .. conf_filename); 696 show_message("Config written to " .. conf_filename);
692 return nil, conf_filename; 697 return nil, conf_filename;