Skip to content

Commit db1a193

Browse files
committed
make https optional
1 parent 088a13f commit db1a193

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

robusta/src/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ pub struct Config {
2222
/// The last value is repeated forever.
2323
#[builder(default = [1, 3, 5, 10, 15])]
2424
pub(crate) delays: [u8; NUM_DELAYS.get()],
25+
26+
/// Submitter should connect only with https?
27+
pub(crate) https_only: bool,
2528
}
2629

2730
impl Config {

robusta/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct Client {
3535
impl Client {
3636
pub fn new(c: Config) -> Self {
3737
let r = reqwest::Client::builder()
38-
.https_only(true)
38+
.https_only(c.https_only)
3939
.timeout(Duration::from_secs(30))
4040
.build()
4141
.expect("TLS and DNS resolver work");
@@ -298,6 +298,7 @@ mod tests {
298298
.unwrap(),
299299
)
300300
.label("decaf_smoke")
301+
.https_only(true)
301302
.build();
302303

303304
let clt = Client::new(cfg.clone());

timeboost-builder/src/submit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ mod tests {
296296
.unwrap(),
297297
)
298298
.label(k.public_key().to_string())
299+
.https_only(true)
299300
.build();
300301

301302
let scfg = SubmitterConfig::builder()

timeboost-proto/protos

timeboost/src/binaries/timeboost.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@ struct Cli {
6464
#[clap(long, default_value = "wss://query.decaf.testnet.espresso.network/v1/")]
6565
espresso_websocket_url: Url,
6666

67+
/// Hotshot namespace for a chain
6768
#[clap(long)]
6869
namespace: u64,
6970

71+
/// Submitter should connect only with https?
72+
#[clap(long, default_value_t = true)]
73+
https_only: bool,
74+
7075
/// The until value to use for the committee config.
7176
#[cfg(feature = "until")]
7277
#[clap(long, default_value_t = 1000)]
@@ -215,6 +220,7 @@ async fn main() -> Result<()> {
215220
.base_url(cli.espresso_base_url)
216221
.wss_base_url(cli.espresso_websocket_url)
217222
.label(pubkey.to_string())
223+
.https_only(cli.https_only)
218224
.build(),
219225
Vec::new(),
220226
))

0 commit comments

Comments
 (0)