Skip to content

Commit bd034a3

Browse files
committed
tls endpoint support in lidi send and receive
1 parent 5d8afe0 commit bd034a3

17 files changed

Lines changed: 736 additions & 103 deletions

File tree

Cargo.lock

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config_examples/tcp.config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[common]
21
mtu = 9000
32
ports = [5001, 5002, 5003, 5004]
43
block = 300_000

config_examples/tls.config.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[send.tls]
2+
key = "/tmp/ca/intermediate/private/server.key.pem"
3+
certificate = "/tmp/ca/intermediate/certs/server.cert.pem"
4+
ca = "/tmp/ca/intermediate/certs/ca-chain.cert.pem"
5+
#tls_min = "tls1_3"
6+
#tls_method = "mozilla_modern_v5"
7+
#ciphers = "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256"
8+
#groups = "secp521r1:secp384r1:brainpoolP512r1tls13:brainpoolP384r1tls13:brainpoolP256r1tls13"
9+
10+
[[send.from]]
11+
tls = "127.0.0.1:4000"
12+
13+
[receive.tls]
14+
key = "/tmp/ca/intermediate/private/client.key.pem"
15+
certificate = "/tmp/ca/intermediate/certs/client.cert.pem"
16+
ca = "/tmp/ca/intermediate/certs/ca-chain.cert.pem"
17+
#tls_min = "tls1_3"
18+
#tls_method = "mozilla_modern_v5"
19+
#ciphers = "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256"
20+
#groups = "secp521r1:secp384r1:brainpoolP512r1tls13:brainpoolP384r1tls13:brainpoolP256r1tls13"
21+
22+
[[receive.to]]
23+
tls = "127.0.0.1:7000"
24+
25+

lidi-clients/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ clap = { version = "4", default-features = false, features = [
1818
"usage",
1919
] }
2020
log = { version = "0", default-features = false, features = ["std"] }
21+
openssl = { version = "0", optional = true, default-features = false }
2122
rand = { version = "0", default-features = false, features = [
2223
"std",
2324
"sys_rng",
@@ -29,4 +30,6 @@ simplelog = { version = "0", default-features = false, features = [
2930
twox-hash = { version = "2", optional = true, default-features = false, features = [ "std", "xxhash3_128" ] }
3031

3132
[features]
33+
default = [ "hash", "tls" ]
3234
hash = [ "dep:twox-hash" ]
35+
tls = [ "dep:openssl" ]

lidi-command-utils/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ workspace = true
1111
clap = { version = "4", optional = true, default-features = false, features = [ "color", "derive", "std", "usage", "suggestions" ] }
1212
libc = { version = "0", default-features = false, features = ["std"] }
1313
log = { version = "0", default-features = false, features = [ "std", "serde" ] }
14+
openssl = { version = "0", optional = true, default-features = false }
1415
serde = { version = "1", default-features = false, features = [ "std", "derive" ] }
1516
simplelog = { version = "0", default-features = false, features = [
1617
"termcolor",
@@ -21,5 +22,6 @@ twox-hash = { version = "2", optional = true, default-features = false, features
2122

2223
[features]
2324
default = [ ]
24-
hash = [ "dep:twox-hash" ]
2525
command-line = [ "dep:clap" ]
26+
hash = [ "dep:twox-hash" ]
27+
tls = [ "dep:openssl" ]

lidi-command-utils/src/command_line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl TryFrom<CommonArgs> for config::Config {
6363
}
6464

6565
if let Some(ports) = args.ports {
66-
config.common_mut().ports = ports;
66+
config.common_mut().ports = Some(ports);
6767
}
6868

6969
if let Some(block) = args.block {

0 commit comments

Comments
 (0)