Skip to content

Fix incorrect callback caching #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Jun 16, 2025

Motivation:

The certificate override callback incorrectly cached results on the SSLContext, instead of the SSLConnection. The result is that it would only fire once for a given SSLContext, instead of on every connection, incorrectly caching the result indefinitely.

Modifications:

Move the callback state to SSLConnection
Write tests to validate that the callback is called the right
number of times.

Result:

Better behaviour.

Motivation:

The certificate override callback incorrectly cached results on the
SSLContext, instead of the SSLConnection. The result is that it would
only fire once for a given SSLContext, instead of on every connection,
incorrectly caching the result indefinitely.

Modifications:

Move the callback state to SSLConnection
Write tests to validate that the callback is called the right
    number of times.

Result:

Better behaviour.
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Jun 16, 2025
@Lukasa Lukasa merged commit 36b4895 into apple:main Jun 16, 2025
39 checks passed
@Lukasa Lukasa deleted the cb-fix-incorrect-cert-caching branch June 16, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants