Dever v0.0.2
This commit is contained in:
commit
e6e175ebcf
816 files changed
+120349
No files matched your search
@@ -0,0 +1,12 @@
|
||||
use dever_runtime::{task, Bytes};
|
||||
let fixtures = std::path::Path::new(@tls_fixtures@);
|
||||
let ca = Bytes::from(std::fs::read(fixtures.join("root.pem")).unwrap());
|
||||
let cert = Bytes::from(std::fs::read(fixtures.join("server.pem")).unwrap());
|
||||
let key = Bytes::from(std::fs::read(fixtures.join("server-key.pem")).unwrap());
|
||||
assert_eq!(format!("{:?}", @defaultTls@()), "ClientTls");
|
||||
assert_eq!(format!("{:?}", @clientTls@(&ca).unwrap()), "ClientTls");
|
||||
assert_eq!(format!("{:?}", @serverTls@(&cert, &key).unwrap()), "ServerTls");
|
||||
assert!(@clientTls@(&Bytes::new()).is_err());
|
||||
assert!(@serverTls@(&cert, &Bytes::new()).is_err());
|
||||
let configured = task::run(true, 8, async |scope| @scheduledTls@(scope, ca.clone()).await).unwrap().unwrap();
|
||||
assert_eq!(format!("{configured:?}"), "ClientTls");
|
||||
Reference in new issue
Block a user