On Ubuntu you can use the netstat utility to see open ports:

$ netstat -tulpn

You can also verify that stunnel is running using nmap to check if the stunnel port is open:

$ sudo nmap localhost

Generate 2048 key:

openssl genrsa -out cleserveur.key 2048

Generate CSR :

openssl req -new -key cleserveur.key -out demandecertif.csr

Generate auth certificat :

openssl x509 -req -days 365 -in demandecertif.csr -signkey cleserveur.key -out certserver.crt

Generate pem :

cat cleserveur.key > server.pem && cat certserver.crt >> server.pem

stunnel should have direct internet access:

 sudo route add gw dev wlp2s0