acme_proxy/config/types/
challenge.rs1use serde::Deserialize;
8
9use super::empty_string_is_no_values;
10
11#[derive(Debug, Clone, Deserialize)]
13#[serde(default)]
14pub struct ChallengeConfig {
15 #[serde(deserialize_with = "empty_string_is_no_values")]
16 pub enabled: Vec<String>,
17 pub bypass: bool,
28 pub timeout_ms: u64,
29 pub http_01: Http01Config,
30 pub tls_alpn_01: TlsAlpnConfig,
31}
32
33impl Default for ChallengeConfig {
34 fn default() -> Self {
35 Self {
36 enabled: vec!["http-01".to_string()],
37 bypass: false,
38 timeout_ms: 5000,
39 http_01: Http01Config::default(),
40 tls_alpn_01: TlsAlpnConfig::default(),
41 }
42 }
43}
44#[derive(Debug, Clone, Deserialize)]
46#[serde(default)]
47pub struct Http01Config {
48 pub port: u16,
49 pub https_port: u16,
50 pub follow_redirects: bool,
51 pub max_redirects: u8,
52 pub max_response_bytes: usize,
53}
54
55impl Default for Http01Config {
56 fn default() -> Self {
57 Self {
58 port: 80,
59 https_port: 443,
60 follow_redirects: true,
61 max_redirects: 5,
62 max_response_bytes: 4096,
63 }
64 }
65}
66#[derive(Debug, Clone, Deserialize)]
68#[serde(default)]
69pub struct TlsAlpnConfig {
70 pub port: u16,
71}
72
73impl Default for TlsAlpnConfig {
74 fn default() -> Self {
75 Self { port: 443 }
76 }
77}