Working sample with Esp8266 and hivemq

I recently started working on a project in which to implement the control of a device using the mqtt protocol.
I chose HiveMQ because I liked the clear and intuitive interface for configuring a mqtt broker.
I tried using the adafruit mqtt library, inspired by this topic, but no success.
File adapted from example:
I got error: Connecting to MQTT… Connection failed

I mention that I took the login data from the HiveMQ configuration console, and the fingerprint from the browser connected to the same console. What am I doing wrong?
Does anyone have a basic example for using a mqtt broker with the esp8266? What library works? Is it possible for the esp8266 to use a certificate instead of the inconvenient fingerprint solution?

Does anyone have any suggestions?

have you tried with an ESP32?

Hi @Vlad ,

Great to see your interest in MQTT and HiveMQ, welcome to the community!

Please refer to the HiveMQ Cloud’s Getting started with Arduino ESP8266 guide.

I hope this helps.
Kind regards,
Dasha from HiveMQ Team