So my SMTP server is listening on localhost and I chose .plain for the secure option.
Nonetheless, Hedwig tries to establish a TLS secured connection when the server supports it.
And that's where my crash occurs. One of the parameters you pass to TLS.Socket in your starttls method is nil and gets force unwrapped later. I hope that helps fixing the issue, but you should also consider changing the approach here. Why do you want to force a TLS connection just because the server supports it? Some people just want to connect to an SMTP server that is listening on the loopback adapter and I don't get the point of creating an encrypted connection to localhost.
So my SMTP server is listening on localhost and I chose .plain for the secure option.
Nonetheless, Hedwig tries to establish a TLS secured connection when the server supports it.
And that's where my crash occurs. One of the parameters you pass to TLS.Socket in your starttls method is nil and gets force unwrapped later. I hope that helps fixing the issue, but you should also consider changing the approach here. Why do you want to force a TLS connection just because the server supports it? Some people just want to connect to an SMTP server that is listening on the loopback adapter and I don't get the point of creating an encrypted connection to localhost.