MCPcopy Create free account
hub / github.com/ElementsProject/lightning / init

Function init

plugins/grpc-plugin/src/tls.rs:45–50  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

43///
44/// Returns the server identity and the root CA certificate.
45pub(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
53fn generate_or_load_identity(

Callers 1

mainFunction · 0.70

Calls 1

Tested by

no test coverage detected