lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jun 27, 2013 at 01:13:45PM +0100, startx wrote:
> On Thu, 27 Jun 2013 19:01:36 +0700
> "Gary V. Vaughan" <gary@vaughan.pe> wrote:
> 
> > 
> > On 27 Jun 2013, at 18:42, startx <startx@plentyfact.org> wrote:
> > 
> > > is anybody aware of a working smtps ( TLSv1) example using
> > > luasocket and luasec?
> > > 
> > > any help is welcome :)
> > 
> > 
> > I haven't tried anything using smtps over TLS with Lua, but if
> > you use mutt, you can at least use this script to determine
> > whether you have a problem with your C libraries (as linked to
> > mutt) or in Lua's wrappers:
> > 
> > https://gist.github.com/gvvaughan/5875899
> > 
> > HTH,
> 
> i have checked for openssl library problems with
> 
> openssl s_client -starttls smtp -connect <servername>:<port>
> 
> against various mail servers, and it seems that this 
> works fine ( receiving 250 OK )

That s_client command uses STARTTLS (the exchange starts with
unencrypted SMTP and then uses the STARTTLS command to start a TLS
session). The code on Github uses SMTPS (connects using TLS straight
away), which is considered deprecated (IIRC) and usually uses a
different port. You'll have to modify the code to check for STARTTLS
availability and send the STARTTLS command and receive the
acknowledgement before doing the TLS handshake.