@Override
    @SuppressWarnings("deprecation")
    public HttpRoute determineRoute(HttpHost target, HttpContext context) {
        if ( ! target.getSchemeName().equals("http") && ! target.getSchemeName().equals("https"))
            throw new IllegalArgumentException("Scheme must be 'http' or 'https' when using HttpToHttpsRoutePlanner, was '" + target.getSchemeName() + "'");

        if (HttpClientContext.adapt(context).getRequestConfig().getProxy() != null)
            throw new IllegalArgumentException("Proxies are not supported with HttpToHttpsRoutePlanner");

        int port = DefaultSchemePortResolver.INSTANCE.resolve(target);
        return new HttpRoute(new HttpHost("https", target.getAddress(), target.getHostName(), port));
    }
{@link HttpRoutePlanner} that changes assumes requests specify the HTTP scheme,
and then changes this to HTTPS, keeping the other host parameters.

@author jonmv
http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java