From 54fdf1c8201312ffedec71595aa6602bb11e7640 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 13 Oct 2020 16:31:03 +0200 Subject: Serialize exceptions in error-handler manually to fix problems with Serialization in some caching frameworks --- .../auth/sl20/tasks/AbstractCreateQualEidRequestTask.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'eaaf_modules/eaaf_module_auth_sl20') diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java index 5be5a61f..56084d94 100644 --- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java +++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java @@ -2,6 +2,7 @@ package at.gv.egiz.eaaf.modules.auth.sl20.tasks; import java.io.Serializable; import java.net.ConnectException; +import java.nio.charset.StandardCharsets; import java.security.cert.CertificateEncodingException; import java.util.ArrayList; import java.util.List; @@ -98,23 +99,18 @@ public abstract class AbstractCreateQualEidRequestTask extends AbstractAuthServl final HttpPost httpReq = new HttpPost(new URIBuilder(vdaQualEidDUrl).build()); final List parameters = new ArrayList<>(); parameters.add(new BasicNameValuePair(SL20Constants.PARAM_SL20_REQ_COMMAND_PARAM, - Base64Url.encode(sl20Req.toString().getBytes("UTF-8")))); + Base64Url.encode(sl20Req.toString().getBytes(StandardCharsets.UTF_8)))); //inject additional request parameters injectAdditionalSL20RequestParams(parameters, executionContext, request); httpReq.setEntity(new UrlEncodedFormEntity(parameters)); - // build http GET request - // URIBuilder sl20ReqUri = new URIBuilder(vdaQualeIDUrl); - // sl20ReqUri.addParameter(SL20Constants.PARAM_SL20_REQ_COMMAND_PARAM, - // Base64Url.encode(sl20Req.toString().getBytes())); - // HttpGet httpReq = new HttpGet(sl20ReqUri.build()); - // set native client header httpReq.addHeader(SL20Constants.HTTP_HEADER_SL20_CLIENT_TYPE, SL20Constants.HTTP_HEADER_VALUE_NATIVE); - log.trace("Request VDA via SL20 with: " + Base64Url.encode(sl20Req.toString().getBytes("UTF-8"))); + log.trace("Request VDA via SL20 with: {}", + Base64Url.encode(sl20Req.toString().getBytes(StandardCharsets.UTF_8))); // request VDA final HttpResponse httpResp = httpClientFactory.getHttpClient(false).execute(httpReq); -- cgit v1.2.3