Skip to content

Commit

Permalink
feat: add set_tls_certificate wrapper function
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Jun 12, 2024
1 parent 4e97390 commit 480aad3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.v
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ pub fn clean() {
C.webui_clean()
}

// == SSL/TLS =================================================================

@[if use_tls ?]
fn set_tls_certificate(certificate_pem string, private_key_pem string) ! {
if !C.webui_set_tls_certificate(&char(certificate_pem.str), &char(private_key_pem.str)) {
return error('Failed setting tls certificate.')
}
}

// == Javascript ==============================================================

// run executes JavaScript without waiting for the response.
Expand Down

0 comments on commit 480aad3

Please sign in to comment.