From f37aa6afcbf59116ba59d3cac9122ae8348614a1 Mon Sep 17 00:00:00 2001 From: Bianca Schnalzer Date: Tue, 29 Aug 2017 10:36:16 +0200 Subject: jce lib update, Error Handling --- .../java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java | 7 +++++-- .../java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java index ee2448f5..46a4dcfc 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java @@ -144,6 +144,7 @@ public class SimpleXMLTrustManager implements X509TrustManager { } } + for (int i = 0; i < certificates_added_list.getLength(); i++) { try { @@ -157,7 +158,9 @@ public class SimpleXMLTrustManager implements X509TrustManager { log.warn("Ignoring XML node: " + certificateNode.getNodeName()); //$NON-NLS-1$ continue; } - + + if (!certificateNode.getTextContent().equals("")) + { String certResource = Constants.RES_CERT_PATH_ADDED + certificateNode.getTextContent(); FileInputStream addedNode = new FileInputStream(certResource); @@ -170,7 +173,7 @@ public class SimpleXMLTrustManager implements X509TrustManager { myKeyStore.setCertificateEntry(certificateNode.getTextContent(), cert); log.debug("Loaded certificate : " + certResource); //$NON-NLS-1$ - + } } catch (Exception ex) { log.error("Failed to load certificate [" + "]", ex); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java index f6c1eb29..31c559db 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java @@ -119,7 +119,8 @@ public class CertificateDownloadSource { continue; } - ConfigProviderImpl cpi = new ConfigProviderImpl(); + if (!certificateNode.getTextContent().equals("")) + {ConfigProviderImpl cpi = new ConfigProviderImpl(); String certResource = Constants.CERTIFICATE_DOWNLOAD_XML_URL + certificateNode.getTextContent(); log.info("===== Starting to download accepted certificates ====="); @@ -136,8 +137,7 @@ public class CertificateDownloadSource { } fis.close(); bis.close(); - - + } } catch (Exception ex) { log.debug(ex.toString()); //$NON-NLS-1$ } -- cgit v1.2.3