Skip to content

Fix web library import on net48: TLS 1.2 + working Refresh/cache TTL (#372, #374) - #373

Merged
jimmytacks merged 2 commits into
mainfrom
issue-372-net48-tls
Sep 4, 2026
Merged

jimmytacks merged 2 commits into
mainfrom
issue-372-net48-tls

Conversation

@jimmytacks

@jimmytacks jimmytacks commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #372
Closes #374

Problem

Since the net48 port (#199), every HTTPS call from the add-in failed with Could not create SSL/TLS secure channel, so only local sources loaded. Once that was fixed, smoke-testing showed the remote repo loading 51 lambdas against 145 locally: four libraries came from a disk cache written in April, and the ribbon Refresh did not help.

Causes

  1. On .NET Framework the TLS versions HttpClient offers come from ServicePointManager.SecurityProtocol. Excel is a native host and the add-in ships no .xll.config, so the AppDomain gets 4.0-era quirks and offers TLS 1.0 only. GitHub requires TLS 1.2+.
  2. Ribbon Refresh only nulled the in-memory provider; the rebuilt one read the same disk cache back.
  3. CacheTtlMinutes was never applied, so cached libraries never expired.

Fix

  • AddIn.AutoOpen enables TLS 1.2/1.3 before any HTTP call.
  • SourceCache takes an optional TTL and treats older entries as misses.
  • LibraryProvider.RefreshAsync(invalidateCache: true) wipes the repo disk cache first; ribbon Refresh uses it.
  • Commands build the provider via one factory that passes the TTL from settings.

Testing

  • Debug build green, 1935 unit tests pass (6 new: TTL expiry, Refresh re-fetch, expired entry re-fetch).
  • Smoke (Tim): load the packed XLL, open the popup, press ribbon Refresh. Expect 145 lambdas from TagloGit/lambda-boss and the log line GitHubSource: Fetched library 'array' (and the other three previously stale libraries).

🤖 Generated with Claude Code

Since the .NET Framework 4.8 port, every HTTPS call from the add-in failed
with "Could not create SSL/TLS secure channel". Excel is a native host and
the add-in ships no .xll.config, so the AppDomain gets 4.0-era quirks and
HttpClient offers TLS 1.0 only, which GitHub rejects. Web library import
silently fell back to local sources and the update check always failed.

Closes #372

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Refresh only dropped the in-memory provider; the rebuilt provider read the
same disk cache back, so libraries cached months ago never updated. The
CacheTtlMinutes setting was also never applied.

- SourceCache takes an optional TTL and treats entries older than it as
  misses (null = no expiry, matching the 0 setting).
- LibraryProvider.RefreshAsync(invalidateCache: true) wipes the repo's disk
  cache before re-fetching; the ribbon Refresh uses it.
- Commands build the provider through one factory that passes the TTL.

Closes #374

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jimmytacks jimmytacks changed the title Enable TLS 1.2/1.3 on net48 so web library import works (#372) Fix web library import on net48: TLS 1.2 + working Refresh/cache TTL (#372, #374) Sep 4, 2026
@jimmytacks
jimmytacks merged commit 8486643 into main Sep 4, 2026
2 checks passed
@jimmytacks
jimmytacks deleted the issue-372-net48-tls branch September 4, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ribbon Refresh never re-fetches from GitHub and CacheTtlMinutes is ignored Web library import fails on net48: TLS handshake error against GitHub

2 participants