love2d-lua-websocket icon indicating copy to clipboard operation
love2d-lua-websocket copied to clipboard

About TLS/SSL

Open flaribbit opened this issue 4 years ago • 3 comments

This library aims to be simple and easy to use. Using SSL libraries will make it difficult to configure and build for lua developers, so WSS connection will not be implemented.

flaribbit avatar Apr 04 '21 02:04 flaribbit

löve-ws with OpenSSL

flaribbit avatar Apr 04 '21 02:04 flaribbit

Just pointing this out for people in the future.

Right now to make work of luasec in love it's a bit complex, but I'm going to write the details here:

You can use old prebuild libraries from here (https://github.com/26F-Studio/love-luasec)

  • Compile luasec or use the prebuilt library
  • Add the require for luasec local ssl = require "ssl" it's fine after line 16
  • On line 73 (it should be 74 now) just add this lines: m.socket = ssl.wrap(m.socket) and m:dohandshake()

If I'm not mistaken, the rest of the library should work without extra changes, but I'll need to test it out in more detail.

Love your pure lua implementation, it's way simpler. And yes, TSL/SSL is pure pain, indeed.

holywyvern avatar Jun 30 '24 10:06 holywyvern

@holywyvern Thank you for your testing and for sharing the steps to make the lib work with luasec. Your instructions are clear and will undoubtedly help other developers who need TLS/SSL support in the future.

f6ee95ac6c30d612dd02cda180a4da21

flaribbit avatar Jun 30 '24 10:06 flaribbit