Ensure that we have a certificate authority, and child keypairs and certificates for the server and the client. It'll generate them in the provided `directory`. The following files are included: - `ca.pem`: The self-signed certificate of the CA - `ca-key.pem`: The key used by the CA to sign certificates - `server.pem`: The server certificate, signed by the CA - `server-key.pem`: The server privat
(directory: &Path)
| 43 | /// |
| 44 | /// Returns the server identity and the root CA certificate. |
| 45 | pub(crate) fn init(directory: &Path) -> Result<(Identity, Vec<u8>)> { |
| 46 | let ca = generate_or_load_identity("cln Root CA", directory, "ca", None)?; |
| 47 | let server = generate_or_load_identity("cln grpc Server", directory, "server", Some(&ca))?; |
| 48 | let _client = generate_or_load_identity("cln grpc Client", directory, "client", Some(&ca))?; |
| 49 | Ok((server, ca.certificate)) |
| 50 | } |
| 51 | |
| 52 | /// Generate a given identity |
| 53 | fn generate_or_load_identity( |
no test coverage detected