Skip to content

decouple from okhttp(3)  #29520

@maxandersen

Description

@maxandersen

Description

Currently quarkus ends up having a dependency to okhttp3 via the kubernetes client. This issue tries to gather the issues/options as fixing this potentially involves collaboration across Quarkus, fabric8 io kubernetes client, operator SDK and the OpenJDK team.

This is a root cause of a list of issues:

  1. CVE issue list for okhttp3 keeps growing (albeit at this time of writing not aware of issues that gets exposed via Quarkus usage of okhttp3 but it is problematic if anyone do need to use okhttp for other means)
  2. We prefer to use one HTTP client (vert.x) to reduce exposure of CVE's and in vert.x case to be able to reuse the same asyn event loop wherever possible
  3. Upgrading to okhttp4 would help on both Switch to the Maven distributed copy of the SubstrateVM annotations #1 and Make it possible to use docker to build native images #2 but then we drag in a reliance on kotlin stdlib which has all kinds of potential downsides when it comes to dependency alignment and support in native.

Thus the best option will be to find ways to not introduce more CVE exposure, not add more libraries and still have good async and native support.

On Kubernetes client side they now have support for different HTTP clients. We should make that work for us!

There are 3 client options:

Jetty

This client is somewhat complete but has some issues around blocking behaviours. Adding Jetty into Quarkus managed dependency set does not sound like a good option.

Users can though update the dependency to use it if they so wish.

JDK http client

This is working but only recommended for Java 16 and upwards due to JDK 11 bug affecting query parameters in websocket based calls.

Also would be improved when cleaner async support merged

The JDK bug we can probably get backported to JDK 11. Will take a few months before broadly available though (January earliest).

vert.x

Current progress is in this branch.
It has issues and is awaiting fabric8io/kubernetes-client#4430 to get merged. This PR fixes issues
around how the client deals with bytebuffers and streams. With this in a vert.x client should be much more manageable to get in.

Implementation ideas

My (Max) preferable option is to get vert.x client enabled as that avoids all the issues know for okhttp.
Secondary option is to get jdk issue fixed allowing users to at least just fall back to the JDK.

Jetty I'm not a fan of as it adds yet another dependency chain to maintain.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions