# Changelog ## 2025-05-20 - 19.3.14 - fix(certificate-manager, smart-proxy) Add error handling around logger calls in route update callback - Added try/catch blocks around logger calls in certificate-manager.ts - Added try/catch blocks around logger calls in smart-proxy.ts related to route updates - Provided fallback to console.log when logger fails - Ensured core route update functionality continues to work even if logging fails ## 2025-05-20 - 19.3.13 - fix(port-manager, certificate-manager) Improve port binding and ACME challenge route integration in SmartProxy - Added reference counting in PortManager so that routes sharing the same port reuse the existing binding. - Enhanced error handling to distinguish internal port conflicts from external ones, with more descriptive messages. - Adjusted ACME challenge route addition to merge with existing port bindings when port is already in use. - Refactored updateRoutes to release orphaned ports and bind only new required ports, minimizing rebinding operations. - Improved certificate-manager logic to provide clearer error notifications when ACME port conflicts occur. ## 2025-05-19 - 19.3.12 - fix(tests) Update test mocks to include provisionAllCertificates methods in certificate manager stubs and related objects. - Added async provisionAllCertificates functions to several test mocks (e.g. in test.port80-management.node.ts, test.route-callback-simple.ts, test.route-update-callback.node.ts, and test.simple-acme-mock.ts) to simulate ACME certificate provisioning. - Enhanced logging and port-add history debugging for ACME challenge port addition. ## 2025-05-19 - 19.3.11 - fix(logger) Replace raw console logging calls with structured logger usage across certificate management, connection handling, and route processing for improved observability. - Replaced console.log, console.warn, and console.error in SmartCertManager with logger.log for more consistent logging. - Updated ConnectionManager and RouteConnectionHandler to log detailed connection events using a structured logger. - Enhanced logging statements with contextual metadata such as connection IDs, remote IPs, target information, and component identifiers. - Standardized log output across proxy modules to aid in debugging and monitoring. ## 2025-05-19 - 19.3.10 - fix(certificate-manager, smart-proxy) Fix race condition in ACME certificate provisioning and refactor certificate manager initialization to defer provisioning until after port listeners are active - Removed superfluous provisionCertificatesAfterPortsReady method - Made provisionAllCertificates public so that SmartProxy.start() calls it after ports are listening - Updated SmartProxy.start() to wait for port setup (via PortManager) before triggering certificate provisioning - Improved ACME HTTP-01 challenge timing so that port 80 (or configured ACME port) is guaranteed to be ready - Updated documentation (changelog and Acme timing docs) and tests to reflect the change ## 2025-05-19 - 19.3.10 - refactor(certificate-manager, smart-proxy) Simplify certificate provisioning code by removing unnecessary wrapper method - Removed superfluous SmartCertManager.provisionCertificatesAfterPortsReady() method - Made SmartCertManager.provisionAllCertificates() public instead - Updated SmartProxy.start() to call provisionAllCertificates() directly - Updated documentation and tests to reflect the change - No functional changes, just code simplification ## 2025-05-19 - 19.3.9 - fix(certificate-manager, smart-proxy) Fix ACME certificate provisioning timing to ensure ports are listening first - Fixed race condition where certificate provisioning would start before ports were listening - Modified SmartCertManager.initialize() to defer certificate provisioning - Added SmartCertManager.provisionCertificatesAfterPortsReady() for delayed provisioning - Updated SmartProxy.start() to call certificate provisioning after ports are ready