[2.7.x] Backport Nexus Client changes.

Those are:
https://github.com/sonatype/nexus-oss/pull/281
https://github.com/sonatype/nexus-oss/pull/322

CI
https://bamboo.zion.sonatype.com/browse/NX-OSSF44