backport from master

it backports to 1.8.x
- https://github.com/jclouds/jclouds/commit/a563dd9fbb7fcca3ba0606ec548f655012bb2d4f
- https://github.com/jclouds/jclouds/commit/f134367c692c70b560c7ba1d6408277725185361