1

The app is developed in Kotlin and I have used okHttpClient to make API calls I am trying to host it on play store but they give me a vulnerability issue:

HostnameVerifier 
Your app(s) are using an unsafe implementation of the HostnameVerifier interface. You can find more information about how to resolve the issue in this Google Help Center article. 

MY CODE:

    private val gson = GsonBuilder().setLenient().create()
private var httpLogger = HttpLoggingInterceptor()
        .setLevel(HttpLoggingInterceptor.Level.BODY)

private val customClient = OkHttpClient.Builder()
        .addInterceptor(httpLogger)
        .addInterceptor(ConnectivityInterceptor())
        .build()
private val sRetrofitBuilder = Retrofit.Builder()
        .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
        .client(customClient)
        .addConverterFactory(GsonConverterFactory.create(gson))
        .baseUrl(DataUtils.getString(R.string.api_base_url))
        .build()

The app is running good in debug release though

5
  • Does this help support.google.com/faqs/answer/7188426?hl=en, stackoverflow.com/questions/40928435/… Commented Sep 26, 2020 at 11:52
  • No this doesn't help Commented Sep 26, 2020 at 12:30
  • Hi @VanshTah Do you got a solution for these issues, I'm also facing this issue in my project, if you got a solution please share a solution for these issues, Thank you in advance Commented Nov 28, 2020 at 6:24
  • Still struggling Commented Nov 29, 2020 at 19:31
  • You should look for an unsecure verifier in one of the libraries that you use. The easiest way I know, is to go trough all suspicious jars in "External Libraries" of your project, and search for HostnameVerifier in each. Commented Apr 13, 2021 at 19:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.