diff options
author | Martin Szulecki | 2012-07-17 19:47:33 +0200 |
---|---|---|
committer | Nikias Bassen | 2012-07-17 19:47:33 +0200 |
commit | a67bf25059e755a5d111410713537885d8e15690 (patch) | |
tree | afededec40c2f12556fbe5a93e137ae75c73ac26 /src | |
parent | 2c362a775310d8d7caf29f2c396f999cc88a0233 (diff) | |
download | idevicerestore-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/tss.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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]); } |