Hi,
you need to configure a SSL configuration in the projects configuration view, please see here how to do that:
https://help.br-automation.com/#/en/6/access_and_security%2Fssl%2Fssl_configuration.html
The https FB in your code then has to reference to this configuration.
Also you could check the following very good descriptions from Jaroslav, which cover the use-cases for SSL communication for OPC UA and mappView, but also contain some general and helpful information for your use-case:
Best regards!