How can I configure stunnel to accpet SSL connections, and connect then to an SSL port on a different server?
Here is my setup:
Our ISP's server, "Mail Server", supports smtp/imap over SSL. (Not starttls. Just over ssl.)
But, I have a bunch of client machines that will only trust a specific, internal, root certificate. Thus, they can not connect to "Mail Server".
For these client machines, I'd like to make a dedicated "Mail Tunnel" host that uses stunnel to listen with an in-house signed SSL certificate, and just forward data to "Mail Server" using a 2nd SSL connection.
Can this be done?
What would be the specific steps for Ubuntu Server 10.10? (I'm not too familiar with persistent service configuration.)
Thank you
I am not familiar with the specifics of 10.10, but I am going to assume that it is pretty close to Debian.
One thing you could do, is basically setup to separate stunnel configurations. On that accepts SSL, and forwards it to a local port, and another that listens on that local port, and then makes SSL connections to the external host. These two can be bound to the loopback interface only so unencrypted data will not cross the network. Just keep in mind that you are basically performing a MITM attack against yourself. I used a setup like this while I was helping diagnose some issues with a web service a guy was developing.
The packaged version of stunnel in Debian/Ubuntu should make this easy. The startup scripts will basically start an instance of stunnel for every configuration file (*.conf) found in /etc/stunnel4. So you can put the two separate configurations in /etc/stunnel4, generate your keys, restart stunnel and it should work.
So here is the first config that accepts the SSL
Your second instance that creates outgoing connections.
To generate the filename.keys for the server.
Your file will look like this.