You can instal stunnel on any modern Mac, just like most opensource software via Macbrew - https://brew.sh
As for how it works.
stunnel is a daemon that can be configured to operate in client mode where it listens on a port. Any incoming connection to the port is then proxied to the remote SSL...