use HttpsURLConnections since youtube.com always uses HTTPS

This helps enforce that the connection is encrypted. If for whatever reason
an unencrypted connection is created, an Exception will be thrown.
pull/136/head
Hans-Christoph Steiner 2015-12-24 14:55:33 +01:00
rodzic ef255d12ae
commit 0265da4ae6
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -7,6 +7,8 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.net.UnknownHostException;
import javax.net.ssl.HttpsURLConnection;
import info.guardianproject.netcipher.NetCipher;
/**
@ -43,7 +45,7 @@ public class Downloader {
String ret = "";
try {
URL url = new URL(siteUrl);
HttpURLConnection con = (HttpURLConnection) NetCipher.getHttpURLConnection(url);
HttpsURLConnection con = NetCipher.getHttpsURLConnection(url);
con.setRequestProperty("Accept-Language", language);
ret = dl(con);
}
@ -88,7 +90,7 @@ public class Downloader {
try {
URL url = new URL(siteUrl);
HttpURLConnection con = (HttpURLConnection) NetCipher.getHttpURLConnection(url);
HttpsURLConnection con = NetCipher.getHttpsURLConnection(url);
ret = dl(con);
}
catch(Exception e) {