update
This commit is contained in:
@ -196,7 +196,19 @@ export class SmtpServer implements ISmtpServer {
|
||||
// Start secure server if configured
|
||||
if (this.options.securePort && this.tlsHandler.isTlsEnabled()) {
|
||||
try {
|
||||
this.secureServer = this.tlsHandler.createSecureServer();
|
||||
// Import the secure server creation utility from our new module
|
||||
// This gives us better certificate handling and error resilience
|
||||
const { createSecureTlsServer } = await import('./secure-server.js');
|
||||
|
||||
// Create secure server with the certificates
|
||||
// This uses a more robust approach to certificate loading and validation
|
||||
this.secureServer = createSecureTlsServer({
|
||||
key: this.options.key,
|
||||
cert: this.options.cert,
|
||||
ca: this.options.ca
|
||||
});
|
||||
|
||||
SmtpLogger.info(`Created secure TLS server for port ${this.options.securePort}`);
|
||||
|
||||
if (this.secureServer) {
|
||||
// Use explicit error handling for secure connections
|
||||
|
Reference in New Issue
Block a user