summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2021-01-19 15:35:18 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2021-01-19 15:35:18 +0100
commitf449eee2e42c73a066475fe7c9dcbbe4fcdc0bb9 (patch)
treeebc4c5da8de6809bab68a2f36d41f574e8197e1b /pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku
parent4d758910e41fbfeed78caf10e1c2bffe042df7ec (diff)
downloadpdf-over-f449eee2e42c73a066475fe7c9dcbbe4fcdc0bb9.tar.gz
pdf-over-f449eee2e42c73a066475fe7c9dcbbe4fcdc0bb9.tar.bz2
pdf-over-f449eee2e42c73a066475fe7c9dcbbe4fcdc0bb9.zip
changed urlconnection to apache http client, new pdf-as version added, a-trust url changed
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java47
1 files changed, 42 insertions, 5 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
index 7d3f986a..613af38f 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
@@ -504,13 +504,49 @@ public class ATrustHandler extends MobileBKUHandler {
Status serverStatus = null;
int waits = 0;
final String ERROR = "Error: Server is not responding"; //$NON-NLS-1$
-
+ HttpClient client;
+
+ //Connection: keep-alive
try {
do {
- urlconnection = new URL(status.getBaseURL() + "/UndecidedPolling.aspx?sid=" + status.getSessionID()) //$NON-NLS-1$
- .openConnection();
- InputStream in = new BufferedInputStream(urlconnection.getInputStream());
+
+ String baseURL = "https://www.handy-signatur.at/mobile/https-security-layer-request";
+
+ client = MobileBKUHelper.getHttpClient(getStatus());
+ String uri = status.getBaseURL() + "/UndecidedPolling.aspx?sid=" + status.getSessionID();
+ GetMethod get = new GetMethod(uri);
+
+ status.getBaseURL();
+ //urlconnection = new URL(status.getBaseURL() + "/UndecidedPolling.aspx?sid=" + status.getSessionID()) //$NON-NLS-1$
+ // .openConnection();
+
+
+ // GET /mobile/https-security-layer-request/UndecidedPolling.aspx?sid=A3_RFOOXWTJGFOQXHZSXIWQPSZQCHBA&_=1610983069567 HTTP/2
+ // Host: www.handy-signatur.at
+ // User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
+ // Accept: application/json, text/javascript, */*; q=0.01
+ // Accept-Language: de,en-US;q=0.7,en;q=0.3
+ // Accept-Encoding: gzip, deflate, br
+ // DNT: 1
+ // Connection: keep-alive
+ // Referer: https://www.handy-signatur.at/mobile/https-security-layer-request/undecided.aspx?sid=A3_RFOOXWTJGFOQXHZSXIWQPSZQCHBA
+ // Cookie: ASP.NET_SessionId=hbplnlm1l5gv25rgknfqc3zt
+ // TE: Trailers
+
+ client.setTimeout(35000);
+ client.setConnectionTimeout(35000);
+ get.addRequestHeader("Accept", "application/json, text/javascript");
+ get.addRequestHeader("Connection", "keep-alive");
+ get.addRequestHeader("Referer", uri);
+ System.out.println("URL" + uri);
+ System.out.println("Cookies " + getStatus().getCookies());
+
+
+ int returnValue = client.executeMethod(get);
+ System.out.println("retVal" + returnValue);
+ //InputStream in = new BufferedInputStream(urlconnection.getInputStream());
+ InputStream in = new BufferedInputStream(get.getResponseBodyAsStream());
isReady = IOUtils.toString(in, "utf-8"); //$NON-NLS-1$
serverStatus = new Status(isReady);
@@ -535,7 +571,8 @@ public class ATrustHandler extends MobileBKUHandler {
} catch (Exception e) {
log.error("handle polling failed" + e.getMessage()); //$NON-NLS-1$
- throw new ATrustConnectionException();
+ //throw new ATrustConnectionException();
+ return false;
}
}