@@ -23,8 +23,6 @@ async fn simple_acme_test() {
23
23
let domain = & domain;
24
24
let request_prefix = format ! ( "https://{LOCAL_HOST}:8443/27" ) ;
25
25
let request_prefix = & request_prefix;
26
- //let https_request_prefix = format!("https://{LOCAL_HOST}:8080/27");
27
- //let https_request_prefix = format!("https://{LOCAL_HOST}:8080/27");
28
26
clean_web_domain_dir ( domain) ;
29
27
clean_cert ( ) ;
30
28
let server = run_server_with_config ( "server_config_acme.conf" ) ;
@@ -42,8 +40,9 @@ async fn simple_acme_test() {
42
40
}
43
41
wait_count +=1 ;
44
42
}
45
-
43
+
46
44
assert_files ( domain, request_prefix, 1 , vec ! [ "" , "index.html" ] ) . await ;
45
+ assert_files ( domain, & format ! ( "http://{LOCAL_HOST}:8443/27" ) , 1 , vec ! [ "" , "index.html" ] ) . await ;
47
46
/*
48
47
wait_count = 0;
49
48
server.abort();
@@ -63,3 +62,31 @@ async fn simple_acme_test() {
63
62
assert_files(domain, request_prefix, 1, vec!["", "index.html"]).await;
64
63
*/
65
64
}
65
+
66
+
67
+ #[ tokio:: test]
68
+ async fn simple_acme_test2 ( ) {
69
+ let domain = LOCAL_HOST . to_owned ( ) ;
70
+ let domain = & domain;
71
+ let request_prefix = format ! ( "https://{LOCAL_HOST}:8443" ) ;
72
+ let request_prefix = & request_prefix;
73
+ clean_web_domain_dir ( domain) ;
74
+ clean_cert ( ) ;
75
+ let server = run_server_with_config ( "server_config_acme.conf" ) ;
76
+ sleep ( Duration :: from_secs ( 2 ) ) . await ;
77
+ upload_file_and_check ( domain, request_prefix, 1 , vec ! [ ] ) . await ;
78
+
79
+ let ( api, _) = get_client_api ( "client_config.conf" ) ;
80
+ let mut wait_count =0 ;
81
+ loop {
82
+ assert ! ( wait_count < 30 , "30 seconds doest not have cert" ) ;
83
+ sleep ( Duration :: from_secs ( 1 ) ) . await ;
84
+ let cert_info = api. get_acme_cert_info ( Some ( get_host_path_from_domain ( domain) . 0 . to_string ( ) ) ) . await . unwrap ( ) ;
85
+ if !cert_info. is_empty ( ) {
86
+ break
87
+ }
88
+ wait_count +=1 ;
89
+ }
90
+
91
+ assert_files ( domain, request_prefix, 1 , vec ! [ "" , "index.html" ] ) . await ;
92
+ }
0 commit comments