Unsafe implementation of the HostnameVerifier interface
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- mobile-dev, networking, security
Direzione di ricerca
Cerca nel codice sorgente Java gli utilizzi di HostnameVerifier e setHostnameVerifier, quindi esamina il verifier personalizzato e il percorso di connessione dell’accordion mostrato nell’issue. Il lavoro è completato quando l’implementazione non si fida più incondizionatamente di ogni hostname, ma applica invece i controlli sull’hostname previsto senza sopprimere gli errori di verifica.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Google now is blocking updates to apps that include libraries that have "unsafe" HostnameVerifier implementations. They seem to pattern match the code so always returning true even from a HostnameVerifier that is only used in a safe context the fact that it always returns true seems to trip the filter.
https://support.google.com/faqs/answer/7188426
To properly handle hostname verification, change the implementation of your custom HostnameVerifier interface to perform the following actions:
- If you are using the HostnameVerifier interface, change the implementation of the verify method to return false whenever the hostname of the server does not meet your expectations.
- If you are using the X509HostnameVerifier interface, change the implementation of the verify methods (variants 1, 2, 3) to raise an SSLException whenever the hostname of the server does not meet your expectations. Ensure that the Exceptions raised within your verify implementation are not caught and suppressed within the method. Suppressing Exceptions in this manner would cause verify to exit normally, leading the app to trust all hostnames.
package com.deezer.sdk.network.b;
...
public class Blues {
...
private static final HostnameVerifier bagpipes = new HostnameVerifier() {
public final boolean verify(String hostname, SSLSession session) {
return true;
}
};
...
private static HttpURLConnection accordion(String var0, String var1, boolean var2) throws IOException {
Object var3;
if (var2) {
((HttpsURLConnection)(var3 = (HttpsURLConnection)(new URL(var0)).openConnection())).setHostnameVerifier(bagpipes);
} else {
var3 = (HttpURLConnection)(new URL(var0)).openConnection();
}
((HttpURLConnection)var3).setRequestProperty("User-Agent", var1);
return (HttpURLConnection)var3;
}
...
}
- Lingua principale
- Java
- Stelle
- 42
- Fork
- 25
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 deezer/android-sample
-
SDK url leads to empty pageAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
deezer/android-sample#23 · 1 reazione ·
-
Unsafe implementation of the HostnameVerifier, Play Store rejects apps with this library (v0.11.2).Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
deezer/android-sample#22 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
deezer/android-sample#21 · 1 commento ·
-
SSL ErrorAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
deezer/android-sample#19 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
deezer/android-sample#18 · 3 commenti ·
Tutte le issue di deezer/android-sample
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
github/copilot-sdk#2793 ·
I maintainer di solito rispondono entro 1 giorno
-
Unify jpa4 into orm8Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100