takanorig / mqtt-bench

Benchmark tool for MQTT Broker
144 stars 67 forks source link

Facing issue to connect Broker over SSL. #9

Open sanket-kulkarni-vmware opened 7 years ago

sanket-kulkarni-vmware commented 7 years ago

I am facing an issue for checking benchmark of broker over SSL.

Command I am using:

~/mqtt-bench -broker=tcp://127.0.0.1:8883 -action=pub -tls=client:ca.crt,client.crt,client.key -x=true

I am getting following error log:

Connected error: Network Error : %!s(<nil>)

gdhgdhgdh commented 7 years ago

:+1: - looking with strace shows that the bytes sent to the remote server are NOT encrypted..

strace -f mqtt-bench -action=pub -broker="tcp://XXXXXXXX-1714791189.eu-west-2.elb.amazonaws.com:8883" -tls=client:root.crt.pem,0000000000000000.crt.pem,0000000000000000.key.pem -x=true


[...]

[pid 17976] getpeername(3, {sa_family=AF_INET, sin_port=htons(8883), sin_addr=inet_addr("52.56.X.X")}, [16]) = 0
[pid 17976] write(3, "\20\33\0\4MQTT\4\2\0\36\0\17mqttbench4638-0", 29 <unfinished ...>
hareeqi commented 7 years ago

Because you are putting the broker address wrong, It should be

-broker=ssl://127.0.0.1:8883 not -broker=tcp://127.0.0.1:8883