(path: &Path, secret: &[u8; CLUSTER_SECRET_LEN])
| 368 | } |
| 369 | |
| 370 | fn write_cluster_secret(path: &Path, secret: &[u8; CLUSTER_SECRET_LEN]) -> crate::Result<()> { |
| 371 | fs::write(path, secret).map_err(|e| crate::Error::Config { |
| 372 | detail: format!("write cluster secret {}: {e}", path.display()), |
| 373 | })?; |
| 374 | super::pem_io::set_private_key_perms(path).map_err(|e| crate::Error::Config { |
| 375 | detail: format!("chmod 0600 {}: {e}", path.display()), |
| 376 | }) |
| 377 | } |
| 378 | |
| 379 | fn read_single_cert(path: &Path) -> crate::Result<CertificateDer<'static>> { |
| 380 | let bytes = fs::read(path).map_err(|e| crate::Error::Config { |
no test coverage detected