summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-07-17 19:47:33 +0200
committerGravatar Nikias Bassen2012-07-17 19:47:33 +0200
commita67bf25059e755a5d111410713537885d8e15690 (patch)
treeafededec40c2f12556fbe5a93e137ae75c73ac26
parent2c362a775310d8d7caf29f2c396f999cc88a0233 (diff)
downloadidevicerestore-a67bf25059e755a5d111410713537885d8e15690.tar.gz
idevicerestore-a67bf25059e755a5d111410713537885d8e15690.tar.bz2
tss: Use https to contact webservices first as we sometimes hit a 404 over http
After a while, Apple's servers have been begun redirecting to a 404 page using a 302 security redirect HTTP status code. By using a secure HTTPS connection retrieving TSS requests started to work fine again.
-rw-r--r--src/tss.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tss.c b/src/tss.c
index e505e6e..2c51e30 100644
--- a/src/tss.c
+++ b/src/tss.c
@@ -323,7 +323,10 @@ plist_t tss_send_request(plist_t tss_request) {
unsigned int size = 0;
char curl_error_message[CURL_ERROR_SIZE];
- const char* urls[3] = {
+ const char* urls[6] = {
+ "https://gs.apple.com/TSS/controller?action=2",
+ "https://17.171.36.30/TSS/controller?action=2",
+ "https://17.151.36.30/TSS/controller?action=2",
"http://gs.apple.com/TSS/controller?action=2",
"http://17.171.36.30/TSS/controller?action=2",
"http://17.151.36.30/TSS/controller?action=2"
@@ -355,6 +358,7 @@ plist_t tss_send_request(plist_t tss_request) {
response->content = malloc(1);
response->content[0] = '\0';
+ curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, &curl_error_message);
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, (curl_write_callback)&tss_write_callback);
curl_easy_setopt(handle, CURLOPT_WRITEDATA, response);
@@ -365,7 +369,7 @@ plist_t tss_send_request(plist_t tss_request) {
if (use_apple_server==0) {
curl_easy_setopt(handle, CURLOPT_URL, "http://cydia.saurik.com/TSS/controller?action=2");
} else {
- int url_index = (retry - 1) % 3;
+ int url_index = (retry - 1) % 6;
curl_easy_setopt(handle, CURLOPT_URL, urls[url_index]);
info("Request URL set to %s\n", urls[url_index]);
}