karolba / lua-mikrotik

A Lua library for talking to the Mikrotik RouterOS API
MIT License
3 stars 4 forks source link

Use of openresty (resty cmd line tool) #1

Open vstath opened 5 years ago

vstath commented 5 years ago

Hi there, perhaps it might make sense to also support resty from openresty distribution?

It would allow TLS, md5 and bitops with the internal LuaJIT of openresty? Practically out of the box.

Does that make sense? If I understand correctly, currently this code uses the API (unencrypted) and it would require quite a bit of external libs to support API-SSL.

With openresty "resty -e filename.lua" all the prerequisites would be met and no external dependencies would be needed. Also openresty supports TCP socket clients coding with Lua out of the box with TLS and can be installed natively in many different Linux distributions.

Just a thought. It's better to use API-SSL, especially when it comes down to network devices.

Repo is here: https://github.com/openresty/resty-cli

karolba commented 5 years ago

Hi,

It would allow TLS, md5 and bitops with the internal LuaJIT of openresty? Practically out of the box.

Thanks, this seems like a great idea.

If I understand correctly, currently this code uses the API (unencrypted)

That's correct, although it's not so bad as the library uses the pre-v6.43 login method which does include simple challenge-response authentication. Having API-SSL would be much better of course.

I've made it possible to use this within Openresty in 063f6cb, not closing this issue since supporting API-SSL isn't added yet.