some dumb funk
This commit is contained in:
parent
9689d2815c
commit
76ced2c3c5
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
@ -13,7 +13,7 @@ colog = "1.3.0"
|
||||
threadpool = "1.8.1"
|
||||
wildcard_ex = "0.1.2"
|
||||
websocket = "0.27.1"
|
||||
serde_json = "1.0.136"
|
||||
serde_json = "1.0.137"
|
||||
|
||||
[features]
|
||||
default = ["use-openssl"]
|
||||
|
@ -11,9 +11,9 @@ pub struct SslCert {
|
||||
fn generate_ctx(cert_file: &str, key_file: &str) -> Option<SslContext> {
|
||||
use openssl::ssl::{SslFiletype, SslMethod};
|
||||
|
||||
let mut ctx = SslContext::builder(SslMethod::tls()).ok()?;
|
||||
ctx.set_private_key_file(&key_file, SslFiletype::PEM).ok()?;
|
||||
ctx.set_certificate_file(&cert_file, SslFiletype::PEM).ok()?;
|
||||
let mut ctx = SslContext::builder(SslMethod::tls()).ok().unwrap();
|
||||
ctx.set_private_key_file(&key_file, SslFiletype::PEM).ok().unwrap();
|
||||
ctx.set_certificate_file(&cert_file, SslFiletype::PEM).ok().unwrap();
|
||||
ctx.check_private_key().ok()?;
|
||||
Some(ctx.build())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user