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 c26a96b commit 383a6f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/lib.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ $if macos {
$if msvc {
#flag -lAdvapi32 -lShell32 -lUser32
}
$if use_tls ? {
#flag -DWEBUI_USE_TLS -DWEBUI_TLS -DNO_SSL_DL -DOPENSSL_API_1_1
#flag -lssl -lcrypto
#flag windows -lBcrypt
} $else {
$if !tls ? {
#flag -DNO_SSL
}
$if webui_log ? {
Expand Down
11 changes: 11 additions & 0 deletions src/lib_d_tls.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module vwebui

#flag -DWEBUI_USE_TLS -DWEBUI_TLS -DNO_SSL_DL -DOPENSSL_API_1_1
#flag -lssl -lcrypto
#flag windows -lBcrypt

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.')
}
}

0 comments on commit 383a6f2

Please sign in to comment.