summaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2015-02-16 00:26:08 +0100
committerSebastian Reichel <sre@ring0.de>2015-02-16 00:26:08 +0100
commit21d2375adf68c62feb19f7d5b93adf94337fe82c (patch)
tree3cc08da5c20206733da331ec1637c34f6859f351 /src/web
parenta2caa35d34a11f3b1dd8bedc1a898faa67450831 (diff)
downloadserial-barcode-scanner-21d2375adf68c62feb19f7d5b93adf94337fe82c.tar.bz2
web: support missing certificate/privatekey config entries
Diffstat (limited to 'src/web')
-rw-r--r--src/web/main.vala15
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) {