This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

SSL communication
#4
For now we only have support for SSL/TLS in client mode, here's a short example. If handshake fails, try setting proto to tlsv1.

Code:
require('socket')
require('ssl')

host = '127.0.0.1'
port = '443'
proto = 'tlsv12' -- can also be 'tlsv1' or 'tlsv11'

sock = socket.tcp()
res, err = sock:connect(host, port)
if res then
  sock = ssl.wrap(sock, proto)
  res, err = sock:dohandshake()

  if res then
    ...
  else
    log('Handshake failed', err)
  end
else
  log('Connect failed', err)
end

sock:close()
Reply


Messages In This Thread
SSL communication - by hrebik - 03.02.2016, 12:49
RE: SSL communication - by admin - 03.02.2016, 16:12
RE: SSL communication - by hrebik - 04.02.2016, 09:14
RE: SSL communication - by admin - 04.02.2016, 09:42
RE: SSL communication - by hrebik - 05.02.2016, 11:31
RE: SSL communication - by admin - 05.02.2016, 17:55

Forum Jump: