(cert_dir: &Path)
| 120 | } |
| 121 | |
| 122 | pub fn do_certificates_exist(cert_dir: &Path) -> bool { |
| 123 | let required_files = [ |
| 124 | "server.pem", |
| 125 | "server-key.pem", |
| 126 | "client.pem", |
| 127 | "client-key.pem", |
| 128 | "ca.pem", |
| 129 | "ca-key.pem", |
| 130 | ]; |
| 131 | |
| 132 | required_files.iter().all(|file| { |
| 133 | let path = cert_dir.join(file); |
| 134 | path.exists() && path.metadata().map(|m| m.len() > 0).unwrap_or(false) |
| 135 | }) |
| 136 | } |
| 137 | |
| 138 | pub async fn get_tls_config(wss_proxy_options: &WssproxyOptions) -> Result<ServerConfig, Error> { |
| 139 | let max_retries = 20; |
no test coverage detected