diff options
author | Sebastian Reichel <sre@ring0.de> | 2015-02-16 00:26:08 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2015-02-16 00:26:08 +0100 |
commit | 21d2375adf68c62feb19f7d5b93adf94337fe82c (patch) | |
tree | 3cc08da5c20206733da331ec1637c34f6859f351 | |
parent | a2caa35d34a11f3b1dd8bedc1a898faa67450831 (diff) | |
download | serial-barcode-scanner-21d2375adf68c62feb19f7d5b93adf94337fe82c.tar.bz2 |
web: support missing certificate/privatekey config entries
-rw-r--r-- | src/web/main.vala | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/web/main.vala b/src/web/main.vala index dd354c5..86caea5 100644 --- a/src/web/main.vala +++ b/src/web/main.vala @@ -21,9 +21,9 @@ string templatedir; public static int main(string[] args) { TlsCertificate? cert = null; - string certificate; - string privatekey; - uint port; + string certificate = ""; + string privatekey = ""; + uint port = 8080; try { db = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database"); @@ -31,8 +31,13 @@ public static int main(string[] args) { cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config"); templatedir = cfg.get_string("WEB", "filepath"); port = cfg.get_integer("WEB", "port"); - certificate = cfg.get_string("WEB", "cert"); - privatekey = cfg.get_string("WEB", "key"); + + try { + certificate = cfg.get_string("WEB", "cert"); + privatekey = cfg.get_string("WEB", "key"); + } catch(KeyFileError e) { + warning("KeyFileError: %s\n", e.message); + } } catch(IOError e) { error("IOError: %s\n", e.message); } catch(KeyFileError e) { |