@@ -56,24 +56,29 @@ pub(crate) struct ProxyServer {
5656 cert_dir : PathBuf ,
5757 reset_tx : broadcast:: Sender < ( ) > ,
5858 https_cert_tx : broadcast:: Sender < ( String , String ) > ,
59+ clear_https_tx : broadcast:: Sender < ( ) > ,
5960 /// `Some` only when the main HTTP server is bound to port 80.
6061 /// Used to hand off port 80 gracefully during ACME HTTP-01 challenges.
6162 port80_pause_tx : Option < mpsc:: Sender < ( oneshot:: Sender < ( ) > , oneshot:: Receiver < ( ) > ) > > ,
6263 /// Shared log receiver - written by `GrpcLogLayer` for every tracing event.
6364 /// Drained during ACME execution to collect proxy log lines for error reporting.
6465 logs_rx : LogsReceiver ,
66+ acme_staging : bool ,
6567}
6668
6769impl ProxyServer {
68- #[ must_use]
6970 /// Create new `ProxyServer`.
71+ #[ must_use]
72+ #[ allow( clippy:: too_many_arguments) ]
7073 pub ( crate ) fn new (
7174 cookie_key : Arc < RwLock < Option < Key > > > ,
7275 cert_dir : PathBuf ,
7376 reset_tx : broadcast:: Sender < ( ) > ,
7477 https_cert_tx : broadcast:: Sender < ( String , String ) > ,
78+ clear_https_tx : broadcast:: Sender < ( ) > ,
7579 port80_pause_tx : Option < mpsc:: Sender < ( oneshot:: Sender < ( ) > , oneshot:: Receiver < ( ) > ) > > ,
7680 logs_rx : LogsReceiver ,
81+ acme_staging : bool ,
7782 ) -> Self {
7883 Self {
7984 cookie_key,
@@ -86,8 +91,10 @@ impl ProxyServer {
8691 cert_dir,
8792 reset_tx,
8893 https_cert_tx,
94+ clear_https_tx,
8995 port80_pause_tx,
9096 logs_rx,
97+ acme_staging,
9198 }
9299 }
93100
@@ -210,8 +217,10 @@ impl Clone for ProxyServer {
210217 cert_dir : self . cert_dir . clone ( ) ,
211218 reset_tx : self . reset_tx . clone ( ) ,
212219 https_cert_tx : self . https_cert_tx . clone ( ) ,
220+ clear_https_tx : self . clear_https_tx . clone ( ) ,
213221 port80_pause_tx : self . port80_pause_tx . clone ( ) ,
214222 logs_rx : Arc :: clone ( & self . logs_rx ) ,
223+ acme_staging : self . acme_staging ,
215224 }
216225 }
217226}
@@ -263,6 +272,7 @@ impl proxy_server::Proxy for ProxyServer {
263272 let connected = Arc :: clone ( & self . connected ) ;
264273 let cookie_key = Arc :: clone ( & self . cookie_key ) ;
265274 let https_cert_tx = self . https_cert_tx . clone ( ) ;
275+ let clear_https_tx = self . clear_https_tx . clone ( ) ;
266276 tokio:: spawn (
267277 async move {
268278 let mut stream = request. into_inner ( ) ;
@@ -288,6 +298,12 @@ impl proxy_server::Proxy for ProxyServer {
288298 ) ;
289299 }
290300 }
301+ core_response:: Payload :: ClearHttpsCerts ( _) => {
302+ info ! ( "Received ClearHttpsCerts from Core" ) ;
303+ if let Err ( err) = clear_https_tx. send ( ( ) ) {
304+ error ! ( "Failed to broadcast ClearHttpsCerts: {err}" ) ;
305+ }
306+ }
291307 other => {
292308 let maybe_rx = results. write ( ) . expect ( "Failed to acquire lock on results hashmap when processing response" ) . remove ( & response. id ) ;
293309 if let Some ( rx) = maybe_rx {
@@ -389,6 +405,7 @@ impl proxy_server::Proxy for ProxyServer {
389405
390406 let pause_tx = self . port80_pause_tx . clone ( ) ;
391407 let logs_rx = Arc :: clone ( & self . logs_rx ) ;
408+ let acme_staging = self . acme_staging ;
392409 tokio:: spawn ( async move {
393410 // Request a graceful hand-off of port 80 from the main HTTP server if it is bound
394411 // there, so the ACME challenge listener can bind.
@@ -432,8 +449,14 @@ impl proxy_server::Proxy for ProxyServer {
432449 }
433450 } ) ;
434451
435- match acme:: run_acme_http01 ( domain. clone ( ) , existing_credentials, permit, progress_tx)
436- . await
452+ match acme:: run_acme_http01 (
453+ domain. clone ( ) ,
454+ existing_credentials,
455+ acme_staging,
456+ permit,
457+ progress_tx,
458+ )
459+ . await
437460 {
438461 Ok ( acme_result) => {
439462 let cert_event = AcmeIssueEvent {
0 commit comments