some dumb funk

This commit is contained in:
MeexReay 2025-04-06 20:09:46 +03:00
parent 9689d2815c
commit 76ced2c3c5
3 changed files with 4 additions and 4 deletions

0
.gitignore vendored Normal file → Executable file
View File

View File

@ -13,7 +13,7 @@ colog = "1.3.0"
threadpool = "1.8.1" threadpool = "1.8.1"
wildcard_ex = "0.1.2" wildcard_ex = "0.1.2"
websocket = "0.27.1" websocket = "0.27.1"
serde_json = "1.0.136" serde_json = "1.0.137"
[features] [features]
default = ["use-openssl"] default = ["use-openssl"]

View File

@ -11,9 +11,9 @@ pub struct SslCert {
fn generate_ctx(cert_file: &str, key_file: &str) -> Option<SslContext> { fn generate_ctx(cert_file: &str, key_file: &str) -> Option<SslContext> {
use openssl::ssl::{SslFiletype, SslMethod}; use openssl::ssl::{SslFiletype, SslMethod};
let mut ctx = SslContext::builder(SslMethod::tls()).ok()?; let mut ctx = SslContext::builder(SslMethod::tls()).ok().unwrap();
ctx.set_private_key_file(&key_file, SslFiletype::PEM).ok()?; ctx.set_private_key_file(&key_file, SslFiletype::PEM).ok().unwrap();
ctx.set_certificate_file(&cert_file, SslFiletype::PEM).ok()?; ctx.set_certificate_file(&cert_file, SslFiletype::PEM).ok().unwrap();
ctx.check_private_key().ok()?; ctx.check_private_key().ok()?;
Some(ctx.build()) Some(ctx.build())
} }