RFC-9289: Towards Remote Procedure Call Encryption
“Special mention goes to Charles Fisher, author of ‘Encrypting NFSv4 with Stunnel TLS’ [LJNL].
His article inspired the mechanism described in this document.”
Back when Apple's Mail on a more outdated OS X setup stopped to be able to connect to various mail servers because of Apple's own outdated SSL/TLS implementation (security.framework?) I just plugged stunnel in the middle to make things work again: Mail connects to localhost and stunnel then safely connects to the remote mail server.
While this was an important fix at that time it also provided surprisingly additional benefits. Now it was much easier to entirely block outgoing connections from Mail with Little Snitch. Instead having numerous allow directives per mailserver, just one full block. E.g. no more random config changes that break everything, because Apple decided to push some auto-config changes for well-known mail providers. No more accidental tracking pixel triggers. Also all the accounts are now just vanilla POP3/SMTP accounts rather than those with "special handling". Finally Mail became much more stable for some reason. No more long lockups when I want to open the Account settings, no more random lockups when launching the app, etc.
Now I really do not want to miss this extra layer anymore because all the bonus benefits (even if it shouldn't be needed any longer just to make SSL/TLS work again).
Over time bunch of other things (Mail unrelated) got plugged into the stunnel config too. :)
I only use it for shell access to machines in my home network, so I cannot remark on performance, but it is also by far the easiest to use VPN solution I've had contact with. Not that I'm an expert in this matter, but setting up Wireguard access was dead simple and it has never given me any trouble since.
No joke, it just came up at work as a possible solution to something. We have some legacy systems that talk over TCP in plaintext. It's all within well-secured networks on locked down machines, so fine. But now we want to move things to Megaport, and their agreement says "btw don't put anything in plaintext ever, we guarantee nothing". So stunnel will probably be the fix.
I was involved in a very similar situation once.
I recommend wireguard for this, it's mature for years, has superb support in linux and some BSDs and there are userspace implementations if you need that.
It wraps traffic in UDP, the overhead is much smaller thus throughput mich higher than traditional TCP-based VPN (you want to avoid tcp-in-tcp!).
There were once patches posted to lkml that passed QoS-flags from the inner packet to the wireguard packet, if you need that. not sure if that landed upstream in the end.
key distribution and lifecycle management is what was still unsolved years back when this was evaluated, nowadays tailscale and its clones and similar oss should serve you well.
Not a security expert and also curious about implications:
I always considered it the best solution to have both: VPN encryption and TLS encryption over the VPN. Different OSI Layers. Different Attack Surfaces.
Not sure if that is a recommended pratice though (see initial remark ;) )
Maybe they need something that works without root and IP space allocation. I like WireGuard and use it myself but it is a bit of an installation compared to binding a port
The company I work for has used it as a relatively simple method for implementing mutual TLS (mTLS) for legacy apps or systems for which it would otherwise be annoying or more difficult to integrate mTLS for, or which doesn’t support mTLS with custom trust store.
same here. This thing is gold for "80% solutions" in that respect. It's easier to sanely integrate with legacy transport protocols than trying to update the legacy code base to implement mutual trust the harder, more direct and more error-prone way, IMO.
Hmmm... Got me thinking, why must all software implement (and maintain) transport security?
The security standard changes/improves over time. With software like stunnel takes care of it, your software could be practically security wise up-to-day forever as long as you or your user keeps their stunnel updated.
I mean, most web application backends don't implement TLS at all, under the assumption that you're using it alongside a reverse proxy. Most of the time this is nginx, but if you want to ensure no bugs are introduced on the HTTP level by the reverse proxy, stunnel is a perfectly fine option.
Right! That, or I otherwise encounter some kind of asymmetry where one side, whether it is a client or server, implements/requires speaking TLS whereas the otherside isn't readily equipped to do so.
I've found stunnel a godsend for bridging the gap. Granted, I am more of a sysadmin-ey type where a few times I've had to abruptly/quickly get something up and running.
Allows me to speak SSL and receive mail. I like that. I sign up for a bunch of stuff that I want RSSified. I don’t want to implement SSL. This does the trick.
https://www.linuxjournal.com/content/encrypting-nfsv4-stunne...
RFC-9289: Towards Remote Procedure Call Encryption
“Special mention goes to Charles Fisher, author of ‘Encrypting NFSv4 with Stunnel TLS’ [LJNL]. His article inspired the mechanism described in this document.”
https://www.rfc-editor.org/info/rfc9289
reply