mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Allow custom certificates when connecting to BN (#2703)
## Issue Addressed Resolves #2262 ## Proposed Changes Add a new CLI flag `--beacon-nodes-tls-certs` which allows the user to specify a path to a certificate file (or a list of files, separated by commas). The VC will then use these certificates (in addition to the existing certificates in the OS trust store) when connecting to a beacon node over HTTPS. ## Additional Info This only supports certificates in PEM format.
This commit is contained in:
@@ -202,6 +202,33 @@ fn use_long_timeouts_flag() {
|
||||
.with_config(|config| assert!(config.use_long_timeouts));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn beacon_nodes_tls_certs_flag() {
|
||||
let dir = TempDir::new().expect("Unable to create temporary directory");
|
||||
CommandLineTest::new()
|
||||
.flag(
|
||||
"beacon-nodes-tls-certs",
|
||||
Some(
|
||||
vec![
|
||||
dir.path().join("certificate.crt").to_str().unwrap(),
|
||||
dir.path().join("certificate2.crt").to_str().unwrap(),
|
||||
]
|
||||
.join(",")
|
||||
.as_str(),
|
||||
),
|
||||
)
|
||||
.run()
|
||||
.with_config(|config| {
|
||||
assert_eq!(
|
||||
config.beacon_nodes_tls_certs,
|
||||
Some(vec![
|
||||
dir.path().join("certificate.crt"),
|
||||
dir.path().join("certificate2.crt")
|
||||
])
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
// Tests for Graffiti flags.
|
||||
#[test]
|
||||
fn graffiti_flag() {
|
||||
|
||||
Reference in New Issue
Block a user