embyt / balloonrss

A simple RSS aggregator that displays messages as balloon tooltips in the windows task bar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trouble with https feed

deep-42-thought opened this issue · comments

Hi,
I have trouble accessing a feed via https:// - using http:// for the same feed works just fine (but I'd prefer to not host the feed via http, because the URI contains credentials to accessing the feed, which I'd like to not make public).
The certificate chain's root is Let's Encrypt. Reading a little in stackoverflow, it seems to point to invalid certificates and -chains, but the site works well in a browser. Is there anything else, that must be done to make a certificate work with .NET?
For reference: The tech-stack of the feed is nginx with a certbot-provided certificate (pretty much standard, if you ask me).

commented

Not much I can help on this as I do not use SSL feeds and never ran in this issue.

Some directions I can give:

The relevant code is RetrieveChannel() in Retriever.cs:119ff:

balloonrss/src/Retriever.cs

Lines 127 to 138 in 5478ba9

WebRequest webReq = (WebRequest)WebRequest.Create(channel.link);
// inhibit proxy authentication error ("(407) Proxyauthentifizierung erforderlich.")
if (webReq is System.Net.HttpWebRequest)
webReq.Proxy.Credentials = CredentialCache.DefaultCredentials;
// do we need HTTP authentication?
if ((channel.httpAuthUsername != null) && (channel.httpAuthPassword != null))
webReq.Credentials = new NetworkCredential(channel.httpAuthUsername, channel.httpAuthPassword);
// perform HTTP request
webResp = webReq.GetResponse();

What could also be relevant:
https://stackoverflow.com/questions/41577093/webrequest-error-could-not-create-ssl-tls-secure-channel

Hope this helps.

I tried around a little further, yesterday, and noticed, that the project is still on .NET framework 3.5 (I tried to compile on linux with .NET Core 6). Looking into the stackoverflow post you linked, I get the feeling, that .NET Framework 3.5 has a quite low default cipher (and probably cannot even speak TLS 1.2 or TLS 1.3 - does this sound reasonable?
Would it be possible for you to migrate to a more recent version of .NET? Then I could look into actually modifying the code :)

commented

Yes, it would make sense to update the code to a current version of .NET.
Not sure, however, when I can spend some time on this. But I will put it on my list...

Thank you for considering this. No hurry, I know, how time consuming these "side projects" (in sum) can be.

commented

I finally found some time to migrate the project to .NET Core 7.0.
However, I did not migrate the used and deprecated WebRequest to HttpClient yet. Feel free, if you want to contribute.