🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #245357

Re: [newspost] and stunnel

#245357
From: John F. Morse
Date: Sun, 24 Apr 2011 16:08
127 lines
6452 bytes
Pepi wrote:
> On Sat, 23 Apr 2011 23:35:55 +0000, Bill wrote:
>> [...]
>> Try using a server name with a HOSTS file entry. For example, use
>> news.fictious.net and make a HOSTS entry
>>
>> 127.0.0.1	news.fictious.net
>>
>> The OS checks the HOSTS file before attempting to check the DNS server.
>>     
>
> Thanks for your response. Appreciated!
>
> Just  one thing, if I make such an entry into the HOSTS file, wouldn't
> newspost try to contact the  news  host  directly,  instead  of  going
> through stunnel?  I mean, the HOSTS file will translate 127.0.0.1 into
> my news host's server name, right?
>   


No. It will show Stunnel's location as "localhost" if you plan on 
running Stunnel on the same computer.

Stunnel's configuration will then have your news host's name or IP, and 
the converted port number.


> I suspect it isn't stunnel that don't understand.  It's  probably  the
> newspost program that has a problem.  Sure, I have the source, but I'm
> lousy at C/C++.
>
> Trying  your suggestion made the  program  come  back  with  the  same
> response, however, i.e., a failure. Perhaps I'm asking too much of the
> program.
>   

You can run Stunnel on the localhost, or on another computer on your LAN.

How you connect to it -- how you "find" it -- depends on your network 
design.

For instance, I go "full throttle" and run a BIND9 DNS name server, so I 
connect using the hostname "stunnel" which I have configured in the 
BIND9 zone file, to go to a specific computer that is running Stunnel.

It can be any computer that the zone file describes, but in my case, 
"stunnel" is simply an alias (a CNAME) for the same computer that is 
running BIND9. IOW, they (BIND9 DNS server and Stunnel) are both running 
on the same computer (along with a Stratum2 ntpd and Fetchmail).

If you do not run a DNS server, then you can use your hosts file to do 
the name resolving. Or you can use "localhost" or "127.0.0.1" (any of 
these "should" work).

The hosts file is simple if you have only one or two computers that need 
to resolve names. More than that number of computers begins to become 
quite a job if something changes. That is where a DNS server fits in. 
Have all your computers look toward it, and make any changes in one 
place (or two, should you run a slave DNS server for backup).

My BIND9 computer is running Stunnel version 3.something, which is quite 
old. I originally started Stunnel by using a terminal command instead of 
using an init.d startup script. The computer is never shut down (it's 
been running solid since November 11, 2006, over four years without 
rebooting!), so a BASH command is what started Stunnel. From a processes 
listing:

john@ns:~$ ps aux
...
root     12236  0.0  0.5  6780  344 ?        Ss   Nov11   0:00 
/usr/sbin/stunnel -c -d nntp -r n102:563
...

The command I entered was "stunnel -c -d nntp -r n102:563" using TTY6.

This command runs Stunnel and tells Stunnel to run in the client mode 
("-c") and to listen in the daemon mode ("-d") and to "[host:]port" but 
since "host" is not provided, it listens to localhost" (the same 
computer on which it is running). I suspect my above command using both 
modes -c and -d is in error, but it works so why fix it? ;-)

The port to which it listens is "nntp" which is equivalent to "Port 119" 
and the "-r [host:]port" tells it to connect to the remote service at 
"n102" using Port 563 (my local news reader server -- that's why the 
hostname has no FQDN because it is local). If the remote host were not 
given, it would default to listening to localhost, for a service running 
on Port 563. That would be a case where you ran something like Leafnode 
for a news server.

I could have used "nntps" instead of "563" for the port number, and the 
computer would have looked up the "563" using the /etc/services database 
just like it does for the "nntp" port lookup to "119" earlier in the 
command.

I suspect you may have overlooked your need for three pieces of 
information to get your newsreader, Stunnel, and a news server to 
communicate: incoming protocol/port, and remote host, and its protocol/port.

If you are using the newer Stunnel4, then you can configure 
/etc/stunnel/stunnel.conf for the listening port/protocol and the remote 
server host, port/protocol. You would add an entry stanza like:

[nntps]
accept  = 119
connect = news.remote.server:563

Of course use the correct hostname for the remote news server.

Also read the stunnel (8) man page about generating the SSL certificate. 
Did you generate one?

Then you configure your local newsreader to access the Stunnel program, 
using Port 119, and probably on localhost.

There are many articles on how to do all of this if you check Google:

http://www.google.com/search?q=stunnel+nntps

Perhaps the first Google hit is exactly what you seek?:

http://forum.soft32.com/linux2/stunnel-NNTP-ftopict30184.html


-- 
John

When a person has -- whether they knew it or not -- already rejected the Truth, by what means do they discern a lie?
Technical Details
Message-ID: <ip1htm$1it$1@n102.xanadu-bbs.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!v102.xanadu-bbs.net!n102.xanadu-bbs.net!.POSTED!not-for-mail
References: <EqmdnWeIGtNGey_QnZ2dnUVZ8nWdnZ2d@giganews.com> <4ksd9t.8te.19.1@news.alt.net> <a92dndkKg8oDiCnQnZ2dnUVZ8tqdnZ2d@giganews.com>

Show Full Headers
Complete Article Headers
Message-ID: <ip1htm$1it$1@n102.xanadu-bbs.net>
Subject: Re: [newspost] and stunnel
Date: Sun, 24 Apr 2011 11:08:21 -0500
From: "John F. Morse" <john@example.invalid>
References: <EqmdnWeIGtNGey_QnZ2dnUVZ8nWdnZ2d@giganews.com> <4ksd9t.8te.19.1@news.alt.net> <a92dndkKg8oDiCnQnZ2dnUVZ8tqdnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!v102.xanadu-bbs.net!n102.xanadu-bbs.net!.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: Xanadu BBS
Lines: 127
Reply-To: dont.bother
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: n102.xanadu-bbs.net 1303661302 1629 192.168.89.210 (24 Apr 2011
X-Complaints-To: newsmaster@xanadu-bbs.net
NNTP-Posting-Date: Sun, 24 Apr 2011 16:08:22 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.24 (X11/20101027)
In-Reply-To: <a92dndkKg8oDiCnQnZ2dnUVZ8tqdnZ2d@giganews.com>
X-Enigmail-Version: 0.96.0