KeyManagerImpl always taking the first client alias
@prbprbprb ci sta già lavorando.
Dal 15/1/2023.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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];
}
- Lingua principale
- Java
- Stelle
- 1.4k
- Fork
- 332
- Merge medio
- 2g 56m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/conscrypt
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 49/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
Tutte le issue di google/conscrypt
Issue simili
-
beginner difficulty: easy documentation good first issue hacktoberfest help wanted observability size/S up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
dmitriy-iliyov/spring-transactional-outbox#82 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RamazanKara/nightjar#264 ·
-
bug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
sylvainmetayer/planning-equipes#495 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
jenkinsci/dark-theme-plugin#778 · 1 commento ·
-
enhancement needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
strimzi/strimzi-kafka-operator#13451 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno