code: public static URI updateToSecureConnectionIfNeeded(URI uri, IClientConfig config,
  			ServerIntrospector serverIntrospector, Server server) {
  		String scheme = uri.getScheme();
  
  		if (StringUtils.isEmpty(scheme)) {
  			scheme = "http";
  		}
  
  		if (!StringUtils.isEmpty(uri.toString())
  				&& unsecureSchemeMapping.containsKey(scheme)
  				&& isSecure(config, serverIntrospector, server)) {
  			return upgradeConnection(uri, unsecureSchemeMapping.get(scheme));
  		}
  		return uri;
  	}
docs: Replace the scheme to the secure variant if needed. If the
  {@link #unsecureSchemeMapping} map contains the uri scheme and
  {@link #isSecure(IClientConfig, ServerIntrospector, Server)} is true, update the
  scheme. This assumes the uri is already encoded to avoid double encoding.
  @param uri to modify if required
  @param config the supplied client configuration
  @param serverIntrospector used to verify if the server provides secure connections
  @param server to verify
  @return {@link URI} updated if required