Android app using an unsafe implementation of the HostnameVerifier interface(Kotlin)

214 views Asked by At

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

0

There are 0 answers