Currently when the email server is using a self signed SSL certificate SMTP will fail and not connect up to the server. Once we add the argument to the tls : { rejectUnauthorized: false } to the formatSMTPConfig function it fixed the issue after we built the docker file.
add tls : { rejectUnauthorized: false } to the config
Replace the false with a SMTP_SSL environment variable
Docker Build fixes Error for SMTP
Expected behavior
When trying to connect up to the SMTP server we were receiving this error
{"level":50,"time":1708545357278,"pid":18,"hostname":"097fb33e7de7","severity":"ERROR","err":{"type":"Error","message":"self-signed certificate","stack":"Error: self-signed certificate\n at TLSSocte\n at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)\n at TLSSocket.emit (node:events:518:28)\n at TLSSocket.emit (node:domain:488:12)\n at TLSSocket._finishInit (node:_tls_wrap:1085:8)\n kedone (node:_tls
at ssl.onhandshakedone (node:_tls_wrap:871:12)","code":"ESOCKET","command":"CONN"},"msg":"self-signed certificate"}
After adding the argument for tls: rejectUnauthorized it fixed the issue.
Additional context
Didn't know if this was suppose to be a bug or a feature needed to the .env
Describe the bug
Currently when the email server is using a self signed SSL certificate SMTP will fail and not connect up to the server. Once we add the argument to the
tls : { rejectUnauthorized: false }
to the formatSMTPConfig function it fixed the issue after we built the docker file.To Reproduce
Steps to reproduce the behavior:
tls : { rejectUnauthorized: false }
to the configfalse
with a SMTP_SSL environment variableExpected behavior
When trying to connect up to the SMTP server we were receiving this error
{"level":50,"time":1708545357278,"pid":18,"hostname":"097fb33e7de7","severity":"ERROR","err":{"type":"Error","message":"self-signed certificate","stack":"Error: self-signed certificate\n at TLSSocte\n at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)\n at TLSSocket.emit (node:events:518:28)\n at TLSSocket.emit (node:domain:488:12)\n at TLSSocket._finishInit (node:_tls_wrap:1085:8)\n kedone (node:_tls at ssl.onhandshakedone (node:_tls_wrap:871:12)","code":"ESOCKET","command":"CONN"},"msg":"self-signed certificate"}
After adding the argument for tls: rejectUnauthorized it fixed the issue.
Additional context
Didn't know if this was suppose to be a bug or a feature needed to the .env