From 9a78b1111f30fc3e0a7058a7a918e3d26dfc4fb8 Mon Sep 17 00:00:00 2001 From: Mirko Teodorovic Date: Mon, 5 Aug 2019 09:43:05 +0000 Subject: [PATCH] update mqtts commands (#815) Signed-off-by: Mirko Teodorovic --- docs/authentication.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/authentication.md b/docs/authentication.md index 0e20ac42..b653af2d 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -47,12 +47,12 @@ curl -s -S -i --cacert docker/ssl/certs/ca.crt --cert docker/ssl/certs/ -P -t channels//messages -h localhost --cafile docker/ssl/certs/ca.crt --cert docker/ssl/certs/.crt --key docker/ssl/certs/.key -m '[{"bn":"some-base-name:","bt":1.276020076001e+09, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}]' +mosquitto_pub -u -P -t channels//messages -h localhost -p 8883 --cafile docker/ssl/certs/ca.crt --cert docker/ssl/certs/.crt --key docker/ssl/certs/.key -m '[{"bn":"some-base-name:","bt":1.276020076001e+09, "bu":"A","bver":5, "n":"voltage","u":"V","v":120.1}, {"n":"current","t":-5,"v":1.2}, {"n":"current","t":-4,"v":1.3}]' ``` #### Subscribe ``` -mosquitto_sub -u -P --cafile docker/ssl/certs/ca.crt --cert docker/ssl/certs/.crt --key docker/ssl/certs/.key -t channels//messages -h localhost +mosquitto_sub -u -P --cafile docker/ssl/certs/ca.crt --cert docker/ssl/certs/.crt --key docker/ssl/certs/.key -t channels//messages -h localhost -p 8883 ``` ### WSS @@ -82,4 +82,4 @@ ws.on('error', (e) => { }) ``` -As you can see, `Authorization` header does not have to be present in the HTTP request, since the key is present in the certificate. However, if you pass `Authorization` header, it _must be the same as the key in the cert_. In the case of MQTTS, `password` filed in CONNECT message _must match the key from the certificate_. In the case of WSS, `Authorization` header or `authorization` query parameter _must match cert key_. \ No newline at end of file +As you can see, `Authorization` header does not have to be present in the HTTP request, since the key is present in the certificate. However, if you pass `Authorization` header, it _must be the same as the key in the cert_. In the case of MQTTS, `password` filed in CONNECT message _must match the key from the certificate_. In the case of WSS, `Authorization` header or `authorization` query parameter _must match cert key_.