Instead of using https://ipaddress:2222 you can install an SSL certificate on https://hostname:2222 and use it to log in. Below are steps to install SSL on hostname, let hostname is server.yourdomain.com
cd /usr/local/directadmin/scripts
./letsencrypt.sh request_single server.yourdomain.com 4096
which will also install the new cert/key/ca files in all respective global places for apache, dovecot, Exim, FTP, and DirectAdmin.
NOTE The hostname value, eg: server.yourdomain.com must match the “servername” value set in the directadmin.conf, or it will not be in hostname mode, but User domain mode instead.
You must then turn on SSL in DA and tell DA to use the carootcert, as well as force the hostname for SSL:
cd /usr/local/directadmin/conf
cd /usr/local/directadmin
./directadmin set SSL 1
./directadmin set carootcert /usr/local/directadmin/conf/carootcert.pem
./directadmin set force_hostname server.yourdomain.com
./directadmin set ssl_redirect_host server.yourdomain.com
service directadmin restart