GithubHelp home page GithubHelp logo

VerneMQ HTTPs support about vernemq HOT 12 OPEN

SameerTi avatar SameerTi commented on May 24, 2024
VerneMQ HTTPs support

from vernemq.

Comments (12)

mths1 avatar mths1 commented on May 24, 2024 1

FWIW Lua also supports https out-of-the-box (not suggesting it is a better option than the webhooks plugin

http.ensure_pool({pool_id = "test"})
ret = http.post("test", "https://www.google.com", "", {x_post_header = "X-POST-HEADER"})
print(ret.status)
body = http.body(ret.ref)
print(body)

from vernemq.

ioolkos avatar ioolkos commented on May 24, 2024

@SameerTi In case you're looking to integrate into a HTTP backend, I think you're better off using the WebHooks plugin. (which also supports HTTPS).


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

SameerTi avatar SameerTi commented on May 24, 2024

Thanks @ioolkos for Quick response.
Requirement is to be able to connect with Oracle via Lua plugin, however, I guess, that's not supported, please correct me If I'm wrong..!!
Hence started to look into "https" direction for Authentication purposes.
If above is not supported, and like you said, to use WebHooks plugin, could you please share some examples of that for "https" ?

from vernemq.

ioolkos avatar ioolkos commented on May 24, 2024

@SameerTi I just noticed that some edits on the doc for 1.12.3 were not merged downstream, so some options regarding HTTPS are missing in the WebHooks docs for newer releases.
Find the basic HTTPS options here: https://docs.vernemq.com/v/1.12.3/plugin-development/webhookplugins#configuring-webhooks
I'll have to merge this forward into docs for newer releases and main branch. Apologies!


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

SameerTi avatar SameerTi commented on May 24, 2024

FWIW Lua also supports https out-of-the-box (not suggesting it is a better option than the webhooks plugin

http.ensure_pool({pool_id = "test"})
ret = http.post("test", "https://www.google.com", "", {x_post_header = "X-POST-HEADER"})
print(ret.status)
body = http.body(ret.ref)
print(body)

Hi @mths1
Thanks for your response.
Do you have any examples of "https" usage inside Lua plugin script , where its required to configure certificates, keyStore etc.?
That would be very helpful

Thanks,
Sameer

from vernemq.

SameerTi avatar SameerTi commented on May 24, 2024

@SameerTi I just noticed that some edits on the doc for 1.12.3 were not merged downstream, so some options regarding HTTPS are missing in the WebHooks docs for newer releases. Find the basic HTTPS options here: https://docs.vernemq.com/v/1.12.3/plugin-development/webhookplugins#configuring-webhooks I'll have to merge this forward into docs for newer releases and main branch. Apologies!

👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq 👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

Hi @ioolkos
Could you please confirm, if both of the below can be turned ON at the same time and be working seamlessly?

plugins.vmq_diversity = on
plugins.vmq_webhooks = on

from vernemq.

ioolkos avatar ioolkos commented on May 24, 2024

@SameerTi you can run vmq_webhooks and vmq_diversity in parallel (or rather: in a chain). The way this works is that the first auth plugin will be called and if it returns "next", then the next plugin will be called to authenticate that client.

So, there's 2 things you need to do:

  1. have a load order, defined by the config order in vernemq.conf, or by explicitly configuring a priority:
plugins.vmq_webhooks.priority = 1
plugins.vmq_diversity.priority = 2
  1. Make the first plugin in your chain return "next" (instead of "false") when it cannot auth the client.
    Here's the doc for auth_on_register in the WebHooks plugin:
    https://docs.vernemq.com/plugin-development/webhookplugins#auth_on_register

👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

SameerTi avatar SameerTi commented on May 24, 2024

Hi @ioolkos
If we don't define a Priority on webhooks and diversity, would they still work fine in parallel?

Also, as @mths1 mentioned earlier, that "Lua also supports https out-of-the-box...."

Could you please share any examples of "https" usage inside Lua plugin script where it's required to configure certificates, keyStore etc.? That would be very helpful".

Lua gives us options of receiving a response and apply some custom logic using Lua scripts.
However with Webhooks, it's all configured in vernemq.conf file and then we can't apply our custom logic there, can we?

from vernemq.

ioolkos avatar ioolkos commented on May 24, 2024

@SameerTi as mentioned before, the load order of plugins should be determined by the order you have them in the vernemq.conf. You can also check this with vmq-admin plugin show


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

SameerTi avatar SameerTi commented on May 24, 2024

FWIW Lua also supports https out-of-the-box (not suggesting it is a better option than the webhooks plugin

http.ensure_pool({pool_id = "test"})
ret = http.post("test", "https://www.google.com", "", {x_post_header = "X-POST-HEADER"})
print(ret.status)
body = http.body(ret.ref)
print(body)

Hi @mths1 Thanks for your response. Do you have any examples of "https" usage inside Lua plugin script , where its required to configure certificates, keyStore etc.? That would be very helpful

Thanks, Sameer

Hi @mths1 ,
Appreciate if you could please share any example where certificates are used for "https" calls in lua scripts.

from vernemq.

mths1 avatar mths1 commented on May 24, 2024

@SameerTi : As far as I can tell, it is currently not possible to add a ca or somethine to the diversity plugin. Webhook has support. I can see two use cases: certificate pinning and self-signed certificates. Adding a configuration option to both plugins to specify a ca wouldn't be too hard.

@ioolkos : What do you think?

from vernemq.

ioolkos avatar ioolkos commented on May 24, 2024

Regarding vmq_diversity, I'm open to any extensions (or experiments). Or regarding Luerl, I should actually say. We've always kept it close to the use case of hook implementations.


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

from vernemq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.