@@ -263,8 +263,6 @@ impl proxy_server::Proxy for ProxyServer {
263263 let connected = Arc :: clone ( & self . connected ) ;
264264 let cookie_key = Arc :: clone ( & self . cookie_key ) ;
265265 let https_cert_tx = self . https_cert_tx . clone ( ) ;
266- let current_id = Arc :: clone ( & self . current_id ) ;
267- let port80_pause_tx = self . port80_pause_tx . clone ( ) ;
268266 tokio:: spawn (
269267 async move {
270268 let mut stream = request. into_inner ( ) ;
@@ -290,87 +288,6 @@ impl proxy_server::Proxy for ProxyServer {
290288 ) ;
291289 }
292290 }
293- core_response:: Payload :: AcmeChallenge ( req) => {
294- info ! (
295- domain = %req. domain,
296- "Received ACME challenge request from Core"
297- ) ;
298- let clients_clone = Arc :: clone ( & clients) ;
299- let acme_id = Arc :: clone ( & current_id) ;
300- let pause_tx = port80_pause_tx. clone ( ) ;
301- tokio:: spawn ( async move {
302- // `pause_tx` is `Some` only when the main server
303- // is on port 80 and port 80 may still be in use.
304- // Request a hand-off if so; otherwise proceed directly.
305- let permit = if let Some ( tx) = pause_tx {
306- let ( ready_tx, ready_rx) = oneshot:: channel :: < ( ) > ( ) ;
307- let ( done_tx, done_rx) = oneshot:: channel :: < ( ) > ( ) ;
308- if tx. send ( ( ready_tx, done_rx) ) . await . is_err ( ) {
309- error ! (
310- "Failed to request port-80 hand-off \
311- for ACME; HTTP server may have stopped"
312- ) ;
313- return ;
314- }
315- Some ( acme:: Port80Permit {
316- ready : ready_rx,
317- done_tx,
318- } )
319- } else {
320- None
321- } ;
322- let ( progress_tx, _progress_rx) =
323- mpsc:: unbounded_channel ( ) ;
324- match acme:: run_acme_http01 (
325- req. domain ,
326- req. account_credentials_json ,
327- permit,
328- progress_tx,
329- )
330- . await
331- {
332- Ok ( result) => {
333- let id = acme_id
334- . fetch_add ( 1 , Ordering :: Relaxed ) ;
335- let msg = CoreRequest {
336- id,
337- device_info : None ,
338- payload : Some (
339- core_request:: Payload :: AcmeCertificate (
340- crate :: proto:: AcmeCertificate {
341- cert_pem : result. cert_pem ,
342- key_pem : result. key_pem ,
343- account_credentials_json :
344- result
345- . account_credentials_json ,
346- } ,
347- ) ,
348- ) ,
349- } ;
350- let clients_lock =
351- clients_clone. read ( ) . expect (
352- "Failed to lock clients map for ACME \
353- certificate send",
354- ) ;
355- for tx in clients_lock. values ( ) {
356- if let Err ( err) =
357- tx. send ( Ok ( msg. clone ( ) ) )
358- {
359- error ! (
360- "Failed to send AcmeCertificate \
361- to core: {err}"
362- ) ;
363- }
364- }
365- }
366- Err ( err) => {
367- error ! (
368- "ACME HTTP-01 issuance failed: {err:#}"
369- ) ;
370- }
371- }
372- } ) ;
373- }
374291 other => {
375292 let maybe_rx = results. write ( ) . expect ( "Failed to acquire lock on results hashmap when processing response" ) . remove ( & response. id ) ;
376293 if let Some ( rx) = maybe_rx {
0 commit comments