(cert_dir: &Path)
| 108 | } |
| 109 | |
| 110 | pub fn do_certificates_exist(cert_dir: &Path) -> bool { |
| 111 | let required_files = [ |
| 112 | "server.pem", |
| 113 | "server-key.pem", |
| 114 | "client.pem", |
| 115 | "client-key.pem", |
| 116 | "ca.pem", |
| 117 | "ca-key.pem", |
| 118 | ]; |
| 119 | |
| 120 | required_files.iter().all(|file| { |
| 121 | let path = cert_dir.join(file); |
| 122 | path.exists() && path.metadata().map(|m| m.len() > 0).unwrap_or(false) |
| 123 | }) |
| 124 | } |
| 125 | |
| 126 | pub async fn get_tls_config(wss_proxy_options: &WssproxyOptions) -> Result<ServerConfig, Error> { |
| 127 | let max_retries = 20; |
no test coverage detected