summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/ProviderAPI.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-03-26 12:15:09 +0100
committerParménides GV <parmegv@sdf.org>2014-03-26 12:15:09 +0100
commitc946bed3e63d9d271cd08d4c33e564a157908c36 (patch)
treee5869abb9eb941e340a7968b34225c7a58199161 /src/se/leap/bitmaskclient/ProviderAPI.java
parent0323676ef98b12af3c7ce20bf4101bdc900ef654 (diff)
parent8a754e30011bf60ac9bff2cf987c3fa263b3d924 (diff)
Merge branch 'develop' into release-0.5
Diffstat (limited to 'src/se/leap/bitmaskclient/ProviderAPI.java')
-rw-r--r--src/se/leap/bitmaskclient/ProviderAPI.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/se/leap/bitmaskclient/ProviderAPI.java b/src/se/leap/bitmaskclient/ProviderAPI.java
index 5344e471..7aafa2e3 100644
--- a/src/se/leap/bitmaskclient/ProviderAPI.java
+++ b/src/se/leap/bitmaskclient/ProviderAPI.java
@@ -601,12 +601,12 @@ public class ProviderAPI extends IntentService {
URLConnection url_connection = provider_url.openConnection();
url_connection.setConnectTimeout(seconds_of_timeout*1000);
if(!LeapSRPSession.getToken().isEmpty())
- url_connection.addRequestProperty(LeapSRPSession.TOKEN, LeapSRPSession.getToken());
+ url_connection.addRequestProperty(LeapSRPSession.AUTHORIZATION_HEADER, "Token token = " + LeapSRPSession.getToken());
json_file_content = new Scanner(url_connection.getInputStream()).useDelimiter("\\A").next();
} catch (MalformedURLException e) {
json_file_content = formatErrorMessage(R.string.malformed_url);
} catch(SocketTimeoutException e) {
- json_file_content = formatErrorMessage(R.string.server_is_down_message);
+ json_file_content = formatErrorMessage(R.string.server_unreachable_message);
} catch (IOException e) {
if(provider_url != null) {
json_file_content = downloadWithProviderCA(string_url, danger_on);
@@ -638,13 +638,13 @@ public class ProviderAPI extends IntentService {
(HttpsURLConnection)url.openConnection();
urlConnection.setSSLSocketFactory(getProviderSSLSocketFactory());
if(!LeapSRPSession.getToken().isEmpty())
- urlConnection.addRequestProperty(LeapSRPSession.TOKEN, LeapSRPSession.getToken());
+ urlConnection.addRequestProperty(LeapSRPSession.AUTHORIZATION_HEADER, "Token token=" + LeapSRPSession.getToken());
json_file_content = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next();
} catch (CertificateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnknownHostException e) {
- json_file_content = formatErrorMessage(R.string.server_is_down_message);
+ json_file_content = formatErrorMessage(R.string.server_unreachable_message);
} catch (IOException e) {
// The downloaded certificate doesn't validate our https connection.
if(danger_on) {
@@ -727,7 +727,7 @@ public class ProviderAPI extends IntentService {
System.out.println("String ignoring certificate = " + string);
} catch (FileNotFoundException e) {
e.printStackTrace();
- string = formatErrorMessage(R.string.server_is_down_message);
+ string = formatErrorMessage(R.string.server_unreachable_message);
} catch (IOException e) {
// The downloaded certificate doesn't validate our https connection.
e.printStackTrace();