Apply SSL for a particular port – Ubuntu Server 18.04 VPS

I run a service in a particular port (like 3337) on the Ubuntu 18.04 VPS server. I want to give the SSL certificate for this port. I already know how to generate a self-signed certificate with OpenSSL. But I do not know how to apply SSL on a particular port. Please give an idea about this.

Thank you…