News for hackers. Stuff that matters.
Re:Stunnel by tbrownaw on Thursday January 22, 2026 @09:18PM (#46727562)
Is there anything that isn't horribly outdated that still needs this?
Re:Stunnel by patmcc on Thursday January 22, 2026 @10:32PM (#46728072)
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.
Re:Stunnel by nine_k on Thursday January 22, 2026 @11:32PM (#46728445)
Not wireguard?
Re:Stunnel by 01HNNWZ0MV43FF on Friday January 23, 2026 @01:21AM (#46729096)
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
Re:Stunnel by pfix on Friday January 23, 2026 @02:28AM (#46729549)
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 ;) )

Re:Stunnel by Piraty on Friday January 23, 2026 @04:31AM (#46730394)
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.
Re:Stunnel by danlitt on Friday January 23, 2026 @06:44AM (#46731352)
This is cool, but "legacy systems that talk over TCP in plaintext" sounds like it might qualify for "horribly outdated", no?
Re:Stunnel by patmcc on Friday January 23, 2026 @12:12PM (#46734965)
I mean...fair. All I can say is it's still very critical and in production. I guess it's just worth pointing out that horribly outdated things still need support :)
Re:Stunnel by pixl97 on Friday January 23, 2026 @12:30PM (#46735195)
A different way to think of this is...

"Everyday you get electricity, water, transportation, food, and general survival are dependant on horrifically outdated software systems that aren't going to be changed any time soon"

Re:Stunnel by ray_v on Thursday January 22, 2026 @09:36PM (#46727657)
Let me introduce you to software for public library information systems that still thinks it's the 90s!
Re:Stunnel by tingletech on Thursday January 22, 2026 @10:31PM (#46728054)
wrapping z39.50?
Re:Stunnel by TheFinalDraw on Thursday January 22, 2026 @10:58PM (#46728235)
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.
Re:Stunnel by ephaeton on Friday January 23, 2026 @05:30AM (#46730812)
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.
Re:Stunnel by ectospheno on Thursday January 22, 2026 @10:00PM (#46727825)
Re:Stunnel by hwj on Friday January 23, 2026 @06:55AM (#46731439)
Another Althttpd user here. Being able to write a "microservice" just by making a file executable is awesome.
Re:Stunnel by ranger_danger on Thursday January 22, 2026 @09:24PM (#46727590)
I use it to wrap my gstreamer tcp streams in TLS to send them over the internet, but socat can also do the same thing.
Re:Stunnel by creatonez on Thursday January 22, 2026 @09:40PM (#46727686)
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.
Re:Stunnel by boneitis on Thursday January 22, 2026 @11:59PM (#46728617)
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.

Re:Stunnel by chasil on Friday January 23, 2026 @12:25AM (#46728747)
If you want an encrypted tunnel maintained by inetd or systemd socket activation, then stunnel is easier to use in this context than ssh.

Edit: I put stunnel on port 443 and have it connect to port 80 on my Apache webservers, because I like one way of doing TLS.

This guide has been useful for many years in cipher selection:

https://hynek.me/articles/hardening-your-web-servers-ssl-cip...

Re:Stunnel by nirui on Friday January 23, 2026 @12:26AM (#46728753)
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.

Re:Stunnel by drowsspa on Friday January 23, 2026 @03:55AM (#46730161)
That's basically the idea behind zero trust, isn't it? The idea being that you can't even knock on the TCP port if you're not authenticated
Re:Stunnel by 01HNNWZ0MV43FF on Friday January 23, 2026 @01:19AM (#46729072)
I use Caddy the same way. My web apps aren't allowed to think about TLS, they sit behind Caddy and I'm secure as long as I keep it updated
Re:Stunnel by TheCondor on Friday January 23, 2026 @09:46AM (#46733099)
As someone that has built security applications for most of this century, I can confidently say that when you make security the problem of one device, system, team or entity that it results in insecurity. It might satisfy some auditors but that’s about it.

The most obvious issue is that if any system is compromised, then the attacker can potentially sniff traffic and they are all effectively compromised. The next one, and it’s really key to TLS, is that the app you are proxying probably has an opinion or desired behavior when things can’t be authenticated or are improper. Someone reading you blog and the cert is a day old? Probably not super risky to let them read it. Logging in to the mail server and the keys are bad? You might want the server to just block that.

For like a home lab situation or kind of toy systems? These tools are great, I’ve used stunned more than a few times to hack things together

Re:Stunnel by TZubiri on Friday January 23, 2026 @12:52AM (#46728892)
Is there any other way to do this?

Just slap an HTTPS proxy on top of an pure HTTP server. It's simpler to debug and understand.

Otherwise you need to learn how to slap SSL onto 10 different HTTP things.

Re:Stunnel by eps on Friday January 23, 2026 @04:16AM (#46730292)
Stunnel basically allows you to easily secure existing network protocols.

POP3 over stunnel -> SPOP3.

A very practical solution, both for legacy components and for the cases when you don't want to deal with implementing TLS natively. It's a tool.

Re:Stunnel by renewiltord on Friday January 23, 2026 @05:05AM (#46730612)
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.