First: I don't know if there are any reason to avoid upgrade OkHttp to 4.x. Sorry if I'm sending PR about already rejected topic.


  • Upgrade OkHttp to 4.4.1

According to https://square.github.io/okhttp/upgrading_to_okhttp_4/, 4.x has strict compatibility for 3.x. So upgrade to 4.x by dependency management is safer than typical major upgrade.

Binary compatibility is the ability to compile a program against OkHttp 3.x, and then to run it against OkHttp 4.x. We’re using the excellent japicmp library via its Gradle plugin to enforce binary compatibility. https://square.github.io/okhttp/upgrading_to_okhttp_4/

  • 2 test cases are updated due to OkHttp's internal field name is changed. (RestTemplateBuilderTests.java)

  • Also InfluxDbProperties is changed due to issue in influxdb-java.

  • Under OkHttp3, influxdb-java sends "Authorization: encode(null:null"
  • Under new version of OkHttp, null username & password not leads illegal BasicAuth configuration but throws NullPointer exception.
  • Anyway, if user don't use auth, nothing affected I think.

This issue fixed in https://github.com/influxdata/influxdb-java/pull/644/files#diff-23360835991a654afd56314b41590521L150-R155, but not released yet.

Comment From: wilkinsona

Thanks for the PR, but this has already been considered and rejected.

Comment From: kazuki-ma

Oh, sorry i don't find it. I understand your concern. I seek forward to upgrade it (and spring boot 3.x!)