[SPARK-3286] - Cannot view ApplicationMaster UI when Yarn’s url scheme is ...

...https
So what @tgravescs said applies; this code needs to work with older Hadoop versions.