KeyManagerImpl always taking the first client alias
@prbprbprb 已经在做这个了。
开始于 2023年1月15日。
评估
这个 Issue 还没有评估数据。
描述
In KeyManagerImpl the logic that chooses a client alias in method chooseClientAlias always takes the first client alias. For my use case, I am using the KeyManagerImpl for MTLS communication to the backend.
My scenario is that I have 2 keypairs in my KeymManager keystore. One of the keypair's certificate is about to be expired, so i created a new keypair and both of these keypairs are signed by the same CA, thus when talking to my backend the same Principal Names are return when chooseClientAlias is invoked.
Now the problem comes when the backend removes the expired leaf certificate, but chooseClientAlias still will choose the keypair with the expired certificate and an http 403 will occur despite my keystore having both the expired and the non-expired keypairs.
this happens because of the below
@Override
public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) {
final String[] al = chooseAlias(keyTypes, issuers);
return (al == null ? null : al[0]);
}
Conscrypt KeyManagerImpl will just take the first alias no matter what. Can there be some form of deterministic behaviour where the array of aliases be sorted first b4 returning like below? By doing this i can somehow decide which keypair is used first when creating the keystore.
@Override
public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) {
final String[] al = chooseAlias(keyTypes, issuers);
if (al == null) return null;
Arrays.sort(al);
return al[0];
}
- 主要语言
- Java
- 星标
- 1.4k
- 派生
- 332
- 平均合并
- 2 天 56 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/conscrypt 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 3/5 半天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 49/100
-
难度 4/5 3-5 天 新手友好度 22/100
-
难度 3/5 1-2 天 新手友好度 58/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
admin area
难度 2/5 1-3 小时 新手友好度 65/100
alfio-event/alf.io#1556 ·
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
dependency-review: cross-line creation PRs trip the older line's pinned toolchain advisories (issue #30 allow-list, first instance)可能已有人在做 @Yash200531 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 64/100
HexaHexes/neoforge-mod-template#131 · 2 条评论 ·
维护者通常 1 天内回复