How to connect device using AT-Commands(Simcom) into HiveMQ Cloud

This is my script

AT+CMQTTSTART
+CMQTTSTART: 0

OK
AT+CMQTTACCQ=0,“Test1”,1
OK
AT+CMQTTCONNECT=0,“tcp://xxxx.s1.eu.hivemq.cloud:8883”,60,1,“User Name”,“Password”
OK

+CMQTTCONNECT: 0,31

Its return 31 means connection refused: not authorized
What should I do?

Hi Thitiwat,

Thank you for your interest in MQTT and HiveMQ!

You are connecting to the port 8883 that listening for TLS encrypted connection. In case if your device requires server CA, please check out our Frequently Asked Questions – it contains instructions to get the server certificate.

Kind regards,
Dasha from HiveMQ team