Fixed setRequestMethodViaJreBugWorkaround() to work with HTTPS as well as HTTP

The existign workaround doesn't work for HTTPS connections.