It’s not an https issue. It seems cdn.discordapp.com requires a User-Agent
header in the HTTP request. Furthermore, the site appears to only accept certain formats for User-Agent. It turns out the User-Agent supplied by wget is accepted:
Image createImage(String url)
throws IOException {
URLConnection conn = new URL(url).openConnection();
conn.setRequestProperty("User-Agent", "Wget/1.13.4 (linux-gnu)");
try (InputStream stream = conn.getInputStream()) {
return new Image(stream);
}
}
Without a User-Agent header in the request, the site gives an HTTP 403 Forbidden response.