readr

Minimal Terminal RSS Reader
Log | Files | Refs | README | LICENSE

commit 6dbbd0d33dfbdf2d00a289cd123e2a60131e0102
parent decce743497b6eac8af5ad9e13441ec76e77b162
Author: citbl <citbl@citbl.org>
Date:   Tue, 28 Oct 2025 21:05:13 +1000

clean up and config doco

Diffstat:
Msrc/config.h | 9+++++++++
Msrc/http.c | 3++-
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/config.h b/src/config.h @@ -2,15 +2,24 @@ #define VERSION "v1.6" +// recommended, pass as chrome for reddit feeds #define USER_AGENT \ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 " \ "Safari/537.36" + +// seconds timeout for feed HTTP fetch #define TIMEOUT 15 // source file for RSS URLS, one per line // folder and file must exist #define FEEDS "~/.config/readr/feeds" +// verify SSL chain and ensure non-expiry and revoke status free +#define VERIFY_SSL_PEER 1 + +// enforce SSL cert is for the given host +#define VERIFY_SSL_HOST 1 + // limited by the theorical limit of your OS "threads per process" // 2048 (safe), up to 8196 if configured on modern macOS #define MAX_FEEDS 512 diff --git a/src/http.c b/src/http.c @@ -37,7 +37,8 @@ threaded_fetch(void* url) curl_easy_setopt(curl, CURLOPT_URL, (char*)url); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, VERIFY_SSL_PEER ? 1L : 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, VERIFY_SSL_HOST ? 1L : 0L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, http_write); curl_easy_setopt(curl, CURLOPT_WRITEDATA, blob);