Repository navigation
Conversation
…ache CertCacheManager was a lazily created global singleton, which made the certificate cache impossible to replace in tests and let PacketProxyCAPerUser clear entries that belonged to every CA. Each CA now holds its own CertCacheManager and exposes getCachedKeyStore() / clearCertCache(). CA instances are created once by CAFactory, so the cache lifetime is unchanged, and regenerating or importing the per-user CA now clears only that CA's certificates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CertCacheManagerのシングルトン(getInstance()/ static なclearCache())を削除し、各CAが自分のCertCacheManagerを持つようにしました。#271(OpenVPN)と同じく、シングルトンを減らしてテストで差し替えやすくするための変更です。変更点
CertCacheManager:instanceとgetInstance()を削除。clearCache()をインスタンスメソッドにし、getKeyStore()はsynchronizedメソッドに変更CA:CertCacheManagerをフィールドに持ち、getCachedKeyStore(commonName, domainNames)とclearCertCache()を追加Https/ServerHandshake:CertCacheManager.getInstance().getKeyStore(..., ca)をca.getCachedKeyStore(...)に置き換えPacketProxyCAPerUser:CertCacheManager.clearCache()をclearCertCache()に置き換え挙動への影響
CAのインスタンスはCAFactoryが起動時に1つずつ作って使い回すため、キャッシュの寿命は変わりませんPacketProxyCAPerUserの再生成・インポートで全 CA のキャッシュが消えていましたが、その CA のキャッシュだけが消えるようになります(キャッシュのキーに CA 名が入っていたため、他の CA の証明書は元々影響を受けません)確認
./gradlew build(テストを含む)が成功(JDK 21)By placing an "x" in the box, I hereby understand, accept and agree to be bound by the terms and conditions of the Contribution License Agreement.
🤖 Generated with Claude Code