aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2018-07-26 11:23:47 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2018-07-26 11:23:47 +0200
commita5541ab96512cb78d493516ecf0dfb94a6544f52 (patch)
treecb928932446f58ce97341faa7f78b062252733c2
parente5f2601e931594572f88bb402343e39023dab939 (diff)
downloadpdf-as-4-a5541ab96512cb78d493516ecf0dfb94a6544f52.tar.gz
pdf-as-4-a5541ab96512cb78d493516ecf0dfb94a6544f52.tar.bz2
pdf-as-4-a5541ab96512cb78d493516ecf0dfb94a6544f52.zip
add logger on trace level for request/response debugging
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/sl20/SL20Connector.java4
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java2
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SLDataURLServlet.java6
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/sl20/SL20HttpBindingUtils.java1
4 files changed, 10 insertions, 3 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/sl20/SL20Connector.java b/pdf-as-lib/src/main/java/at/gv/egiz/sl20/SL20Connector.java
index a82771bd..3088a564 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/sl20/SL20Connector.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/sl20/SL20Connector.java
@@ -62,7 +62,9 @@ public class SL20Connector extends BaseSLConnector {
HttpResponse httpResp = httpClient.execute(httpReq);
log.debug("Response from VDA received ");
- return SL20JSONExtractorUtils.getSL20ContainerFromResponse(httpResp);
+ JsonObject sl20Resp = SL20JSONExtractorUtils.getSL20ContainerFromResponse(httpResp);
+ log.trace("SL20 command: " + sl20Resp.toString());
+ return sl20Resp;
} catch (URISyntaxException | IOException e) {
log.warn("Can NOT build SL20 http requst. Reason:" + e.getMessage(), e);
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
index 75249e78..1cef0796 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java
@@ -1805,6 +1805,8 @@ public class PdfAsHelper {
redirectTwoCommand,
null);
+ logger.trace("SL2.0 command: " + respContainer.toString());
+
//workaround for A-Trust
if (request.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE) != null &&
request.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE).equals(SL20Constants.HTTP_HEADER_VALUE_NATIVE)
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SLDataURLServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SLDataURLServlet.java
index 7ddf0a55..31f5a2ef 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SLDataURLServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SLDataURLServlet.java
@@ -93,7 +93,7 @@ public class SLDataURLServlet extends HttpServlet {
}
- logger.trace("Received SL2.0 result: " + sl20Result);
+ logger.trace("Received SL2.0 command: " + sl20Result);
//parse SL2.0 command/result into JSON
try {
@@ -144,6 +144,8 @@ public class SLDataURLServlet extends HttpServlet {
//extract payloaf
JsonObject payLoad = payLoadContainer.getPayload();
+ logger.trace("SL2.0 payLoad on DataURL: " + payLoad.toString());
+
//check response type
if (SL20JSONExtractorUtils.getStringValue(
payLoad, SL20Constants.SL20_COMMAND_CONTAINER_NAME, true)
@@ -175,7 +177,7 @@ public class SLDataURLServlet extends HttpServlet {
List<X509Certificate> sortedCerts = X509Utils.sortCertificates(certs);
logger.debug("Sorting of certificate completed. Select end-user certificate ... ");
- PdfAsHelper.injectCertificate(request, response, Base64.getDecoder().decode(sortedCerts.get(0).getEncoded()), getServletContext());
+ PdfAsHelper.injectCertificate(request, response, sortedCerts.get(0).getEncoded(), getServletContext());
}
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/sl20/SL20HttpBindingUtils.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/sl20/SL20HttpBindingUtils.java
index f5d6ff55..e43ebfcf 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/sl20/SL20HttpBindingUtils.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/sl20/SL20HttpBindingUtils.java
@@ -21,6 +21,7 @@ public class SL20HttpBindingUtils {
public static void writeIntoResponse(HttpServletRequest request, HttpServletResponse response, JsonObject sl20Forward, String redirectURL) throws IOException, URISyntaxException {
//forward SL2.0 command
+ log.trace("SL20 command: " + sl20Forward.toString());
if (request.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE) != null &&
request.getHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE).equals(SL20Constants.HTTP_HEADER_VALUE_NATIVE)) {
log.debug("Client request containts 'native client' header ... ");