Backporting CXF-5609 as per request