🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.free.newsservers
Article #185409

Re: Check certificate for news server (testing neodome)

#185409
From: Ronald
Date: Mon, 08 Jan 2024 21:11
82 lines
5247 bytes
On Mon, 8 Jan 2024 20:23:26 +0100, Carlos E.R. wrote:

>> I set Dialog to a full level-0 log (which is everything), and it still
>> didn't say anything other than the connection failed (socket 0).
> 
> Because the failure is outside of Dialog.

You were right all along. A socket is apparently just a connection, so a
socket error just means a connection error. The error is outside of Dialog.

>> This is what happens when I post to the neodome server.
> stunnel is correctly identifying the problem.

The Dialog log said the host:port connection (which is a socket) failed.

What's good is I asked how to debug this problem and people said to look
inside the sTunnel log - and that's where the real error is found by gosh.

 CERT: Pre-verification error: self-signed certificate
 certificate verify failed

> The server people are doing things easy and cheap, for them, and causing 
> problems for people. What they do is "wrong": A private certificate, and 
> not renewed.

I'm learning more about this as I look up how to resolve this myself.
https://www.stunnel.org/howto.html
 How does stunnel check certificates?
https://ftp.icm.edu.pl/packages/replay.old/ssl/stunnel/faq/certs.html
 Problems with a self-signed certificate

> This is done between private individuals, but is not fine when going public.
> 
> Configuring your side to not verifying the certificate and ignoring it 
> has expired is a hack. It is also a security risk (mild in this case).
> You decide to play along or choose a different server.

It turns out that sTunnel has a capability to "Save Peer Certificate".
https://easynews.support.narkive.com/Voh2l6t6/stunnel-on-windows-7-64bit

This is what it says at that ten year old thread about saving the cert.

"After connecting to Easynews with verify off (or set to 1) use stunnel's
Save Peer Certificate option. This saves the certificate presented by the
server to your hard drive (in my case as peer-nntps.pem). You can then use
verify option, specifying the saved certificate file."

"The stunnel GUI console has an option "Save Peer Certificate" which saves
a copy of this certificate on your hard drive in PEM format. If you set
verify=3 and CAfile as the saved PEM file, stunnel will additionally check
that the certificate has not changed (it's the same as your local copy)
since the last time you connected. That's generally all you need.

However, if the server certificate changes legitimately (as many have
recently) verify=3
will reject the new one and you have to go through the save process again.

As you know, I recently did this with Easynews and stunnel complained that
the new certificate had "self signed components". Jason, in support,
pointed me at this link -
https://certs.godaddy.com/anonymous/repository.pki - where GoDaddy's root
certs are available in various formats.

Sadly PEM is not one of them but, if you have OpenSSL installed, you can
convert from other formats to PEM. I downloaded the DER format file
(gd-class2-root.cer) and used this command to convert it to PEM format.

openssl x509 -in gd-class2-root.cer -inform der -outform pem -out certs.pem

I concatenated this onto the my new peer-nntps.pem file (they are just
ASCII files), reloaded the stunnel configuration, and verify=1/2/3 were all
happy again.

I only use stunnel for my NNTP client so putting everything in one PEM file
is the easiest option for me. If you use stunnel for other protocols and
clients, look at the documentation for CApath which lets you keep a set of
certs in a directory."

But unfortunately, the certificate is expired. So that won't help me.

I found another way that might work with Neodome port 119 & STARTTLS with
sTunnel (as Dialog doesn't support STARTTLS either). I have to test it.
Technical Details
Message-ID: <unhoe1$18s7g$1@paganini.bofh.team>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <undqeu$tpek$1@paganini.bofh.team> <unevbk$6eke$2@solani.org> <ung57r$166to$1@paganini.bofh.team> <s2ss6kxr43.ln2@Telcontar.valinor> <ungg3j$5hkb$5@solani.org> <ungkpf$170ai$1@paganini.bofh.team> <ungl4l$5hkb$8@solani.org> <ungmvt$173od$1@paganini.bofh.team> <ungnhg$5hkb$10@solani.org> <ungpp1$17890$1@paganini.bofh.team> <ungtum$5hkb$12@solani.org> <unh4cq$17q0r$1@paganini.bofh.team> <emut6kxllk.ln2@Telcontar.valinor>

Show Full Headers
Complete Article Headers
Message-ID: <unhoe1$18s7g$1@paganini.bofh.team>
Subject: Re: Check certificate for news server (testing neodome)
Date: Mon, 8 Jan 2024 16:11:29 -0500
From: Ronald <ronald@nospam.me>
References: <undqeu$tpek$1@paganini.bofh.team> <unevbk$6eke$2@solani.org> <ung57r$166to$1@paganini.bofh.team> <s2ss6kxr43.ln2@Telcontar.valinor> <ungg3j$5hkb$5@solani.org> <ungkpf$170ai$1@paganini.bofh.team> <ungl4l$5hkb$8@solani.org> <ungmvt$173od$1@paganini.bofh.team> <ungnhg$5hkb$10@solani.org> <ungpp1$17890$1@paganini.bofh.team> <ungtum$5hkb$12@solani.org> <unh4cq$17q0r$1@paganini.bofh.team> <emut6kxllk.ln2@Telcontar.valinor>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: alt.free.newsservers
Organization: To protect and to server
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 8 Jan 2024 21:11:30 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1339632"; posting-host="R8jzoRbLjiM/r2rQyny/kg.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: 40tude_Dialog/2.0.15.41 (Beta 38)
Cancel-Lock: sha256:U9cXVowNEvy4D7zJ2ctXWf/+bVj2eEOoiH+Xou4tBmg=
X-Notice: Filtered by postfilter v. 0.9.3