How to send the message to a server via mqtts via terminal

Hello Guys,

I have a remote server, on that mqtt broker is running. Mqtt has been secured by ssl certificate and now port 8883 is open to receive the mqtts messages.

Now i have a raspberry pi and i want to use the terminal of raspverry pi to send the mqtts message to my remore server but i got no success. This is the command

mosquitto_pub -h mqtts:// -p 8883 -t test -m "okay" -u aswin -P 123efr -d

where im doing the mistake? if i use simple mqtt then the following command is working fine

mosquitto_pub -h -p 1883 -t test -m "okay" -u aswin -P 123efr -d

Thank you.

You don't mention Node Red....are you setting up the NR MQTT In node to receive the messages?

Have a look here under the chapter Mosquitto_pub -Publish Using SSL