Merge pull request #9 from SpiderOak/report-ssl-pinning-error

Reports SSL Handshake errors when they occur (android)
This commit is contained in:
Andrew Stephan 2014-08-20 13:19:01 -04:00
commit e507759527
4 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,8 @@ public class CordovaHttpDownload extends CordovaHttp implements Runnable {
} catch (HttpRequestException e) {
if (e.getCause() instanceof UnknownHostException) {
this.respondWithError(0, "The host could not be resolved");
} else if (e.getCause() instanceof SSLHandshakeException) {
this.respondWithError("SSL handshake failed");
} else {
this.respondWithError("There was an error with the request");
}

View File

@ -51,6 +51,8 @@ public class CordovaHttpGet extends CordovaHttp implements Runnable {
} catch (HttpRequestException e) {
if (e.getCause() instanceof UnknownHostException) {
this.respondWithError(0, "The host could not be resolved");
} else if (e.getCause() instanceof SSLHandshakeException) {
this.respondWithError("SSL handshake failed");
} else {
this.respondWithError("There was an error with the request");
}

View File

@ -44,6 +44,8 @@ public class CordovaHttpPost extends CordovaHttp implements Runnable {
} catch (HttpRequestException e) {
if (e.getCause() instanceof UnknownHostException) {
this.respondWithError(0, "The host could not be resolved");
} else if (e.getCause() instanceof SSLHandshakeException) {
this.respondWithError("SSL handshake failed");
} else {
this.respondWithError("There was an error with the request");
}

View File

@ -83,6 +83,8 @@ public class CordovaHttpUpload extends CordovaHttp implements Runnable {
} catch (HttpRequestException e) {
if (e.getCause() instanceof UnknownHostException) {
this.respondWithError(0, "The host could not be resolved");
} else if (e.getCause() instanceof SSLHandshakeException) {
this.respondWithError("SSL handshake failed");
} else {
this.respondWithError("There was an error with the request");
}