Compare commits
1 Commits
master
...
websocket-
Author | SHA1 | Date |
---|---|---|
Andri Yngvason | cd030ce503 |
|
@ -21,6 +21,7 @@
|
|||
|
||||
#define X_CFG_LIST \
|
||||
X(bool, enable_auth) \
|
||||
X(bool, enable_tls) \
|
||||
X(string, private_key_file) \
|
||||
X(string, certificate_file) \
|
||||
X(string, username) \
|
||||
|
|
12
src/main.c
12
src/main.c
|
@ -740,12 +740,20 @@ int init_nvnc(struct wayvnc* self, const char* addr, uint16_t port,
|
|||
|
||||
nvnc_set_name(self->nvnc, "WayVNC");
|
||||
|
||||
if (self->cfg.enable_auth &&
|
||||
nvnc_enable_auth(self->nvnc, self->cfg.private_key_file,
|
||||
if (self->cfg.enable_auth) {
|
||||
if (nvnc_enable_auth(self->nvnc, self->cfg.private_key_file,
|
||||
self->cfg.certificate_file, on_auth, self) < 0) {
|
||||
nvnc_log(NVNC_LOG_ERROR, "Failed to enable authentication");
|
||||
goto failure;
|
||||
}
|
||||
} else if (self->cfg.enable_tls) {
|
||||
if (nvnc_load_tls_credentials(self->nvnc,
|
||||
self->cfg.private_key_file,
|
||||
self->cfg.certificate_file) < 0) {
|
||||
nvnc_log(NVNC_LOG_ERROR, "Failed to load TLS credentials");
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
|
||||
if (self->pointer_manager)
|
||||
nvnc_set_pointer_fn(self->nvnc, on_pointer_event);
|
||||
|
|
Loading…
Reference in New Issue