Code Monkey home page Code Monkey logo

Comments (6)

ioolkos avatar ioolkos commented on June 16, 2024

Hi @gdhgdhgdh!
Thanks for asking. I basically still owe an answer to this... see #5 (comment)
Maybe this helps to get you started, but the main problem is how to load the client certs into the MZBench workers. (I could probably upload the prepared cert files for our test certs, if you're interested)

from vmq_mzbench.

gdhgdhgdh avatar gdhgdhgdh commented on June 16, 2024

Thank you :) Ahh I did read through many Github issues and didn't see that one ....

Yes please if you could upload the test certs, then hopefully there will be a clue in there as to how I can reformat our own certs. I knew the transport was the key, but had no idea how to specify the multiple cert files....

from vmq_mzbench.

Stasik0 avatar Stasik0 commented on June 16, 2024

@ioolkos @gdhgdhgdh anyone got luck with tls? I try to connect to hivemq without certificates atm, so setting transport=t(ssl, [t(verify, "verify_none")]) but no connection is possible...

from vmq_mzbench.

gdhgdhgdh avatar gdhgdhgdh commented on June 16, 2024

I haven't used vernemq or the vmq_mzbench since mid 2017, but here's what scrappy info I kept...

The `.erl` files for TLS keys can be created using something like this inside the `erl` shell:

{ok, File} = file:read_file('/path/to/admin.crt').
rp(public_key:pem_decode(File)).

You should end up with output like this that you can put into a .erl file:

<<48,130,3,57,48,130,2,33,160,3,2,1,2,2,1,
                  4,48,13,6,9,42,134,72,134,247,13,1,1,11,
                  5,0,48,22,49,20,48,18,6,3,85,4,3,12,11,
                  69,97,115,121,45,82,83,65,32,67,65,48,
[.........]

or

{'RSAPrivateKey',<<48,130,4,165,2,1,0,2,130,1,1,0,218,
                    163,26,215,182,245,155,59,173,61,26,
                    34,47,249,29,102,117,131,149,0,79,207,
                    252,52,74,161,89,63,116,32,254,80,98,
                    105,31,58,104,89,171,45,129,226,110,

and then use a bench descrption like:

#!benchDL

make_install(git = "https://github.com/gdhgdhgdh/vmq_mzbench.git", branch = "refs/heads/master")

include_resource(cacertsfile1, "ca.erl", erlang)
include_resource(certfile1, "admin.erl", erlang)
include_resource(keyfile1, "admin-priv.erl", erlang)

pool(size = 1,
     worker_type = mqtt_worker):

            connect([t(host, "xxxxxxxxxxxxxxxx.eu-west-2.elb.amazonaws.com"),
                    t(port,8883),
                    t(client,"subscriber1"),
                    t(clean_session,true),
                    t(keepalive_interval,60),
                    t(proto_version,4), t(reconnect_timeout,4),
                    t(transport,
                      t(ssl, [
                        t(reuse_sessions, false),
                        t(cacerts, resource(cacertsfile1)),
                        t(cert,resource(certfile1)),
                        t(key, resource(keyfile1))]
                      ))
                    ])
            wait(1 sec)
            subscribe("loadtest/clients/#", 1)

Hope that helps!

from vmq_mzbench.

Stasik0 avatar Stasik0 commented on June 16, 2024

@gdhgdhgdh public_key:pem_decode(File). gives me just "[], hmmm...

from vmq_mzbench.

Stasik0 avatar Stasik0 commented on June 16, 2024

@gdhgdhgdh

i got it somehow running just by including vertificates from gist (also allows to use web-based ui)

include_resource(cacertsfile, "https://gist.githubusercontent.com/ioolkos/1e6e0107b961caf910a0deb61a7e4a23/raw/041e3c747d75880d0811409c0955ee3f1bfc0784/erlang_ca.erl", erlang)
include_resource(certfile, "https://gist.githubusercontent.com/ioolkos/1e6e0107b961caf910a0deb61a7e4a23/raw/041e3c747d75880d0811409c0955ee3f1bfc0784/erlang_client_cert.erl", erlang)
include_resource(keyfile, "https://gist.githubusercontent.com/ioolkos/1e6e0107b961caf910a0deb61a7e4a23/raw/041e3c747d75880d0811409c0955ee3f1bfc0784/erlang_client_key.erl", erlang

from vmq_mzbench.

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.