diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-02-03 08:51:45 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2017-02-03 08:51:45 +0100 |
commit | 2b68b287aa55dc48e9f3a01bd42d6099bbe1deb2 (patch) | |
tree | 28e34446dc263144a09441120b0483e50e8e95b2 /id/server/moa-id-commons | |
parent | 3573f8ea5a4b269834723da4708bf0bace50fa65 (diff) | |
parent | e25d9bfa5fb81fd275706fb7cbee21fe5add5b19 (diff) | |
download | moa-id-spss-2b68b287aa55dc48e9f3a01bd42d6099bbe1deb2.tar.gz moa-id-spss-2b68b287aa55dc48e9f3a01bd42d6099bbe1deb2.tar.bz2 moa-id-spss-2b68b287aa55dc48e9f3a01bd42d6099bbe1deb2.zip |
Merge branch 'eIDAS_node_implementation' into development_preview
Diffstat (limited to 'id/server/moa-id-commons')
3 files changed, 32 insertions, 6 deletions
diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index d8d2e0d3d..c4007fc80 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -317,15 +317,16 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>2.0.2</version> + <version>3.6.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> - <plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> + <version>3.0.2</version> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor> @@ -375,7 +376,7 @@ </executions> </plugin> - <plugin> +<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> @@ -390,7 +391,7 @@ </goals> </execution> </executions> - </plugin> + </plugin> --> <plugin> <artifactId>maven-enforcer-plugin</artifactId> <version>1.1.1</version> diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java index 6d573efe8..e9f9a7e80 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java @@ -36,6 +36,8 @@ public class MOAIDConstants { //general configuration constants + public static final String DEFAULT_CONTENT_TYPE_HTML_UTF8 = "text/html; charset=UTF-8"; + public static final String FILE_URI_PREFIX = "file:/"; public static final String PREFIX_WPBK = "urn:publicid:gv.at:wbpk+"; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java index 4ecda435d..109390132 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/ssl/SSLUtils.java @@ -61,6 +61,8 @@ import javax.net.ssl.TrustManager; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.KeyStoreUtils; +import at.gv.egovernment.moaspss.logging.LoggingContext; +import at.gv.egovernment.moaspss.logging.LoggingContextManager; import iaik.pki.DefaultPKIConfiguration; import iaik.pki.PKIException; import iaik.pki.PKIFactory; @@ -94,6 +96,21 @@ public class SSLUtils { } + /** + * IAIK PKI module and MOA-SIG uses a ThreadLocal variable for logging + * check if current thread has set this variable and set loggingcontext otherwise + * + * @param url transactionID for logging + */ + private static void checkMoaSigLoggingContext(String url) { + LoggingContextManager logMgr = LoggingContextManager.getInstance(); + if (logMgr.getLoggingContext() == null) { + LoggingContext ctx = new LoggingContext(url); + logMgr.setLoggingContext(ctx); + + } + } + public static SSLSocketFactory getSSLSocketFactory( String url, String certStoreRootDirParam, @@ -111,8 +128,11 @@ public class SSLUtils { Logger.debug("Get SSLSocketFactory for " + url); // retrieve SSLSocketFactory if already created SSLSocketFactory ssf = (SSLSocketFactory)sslSocketFactories.get(url); - if (ssf != null) - return ssf; + if (ssf != null) { + checkMoaSigLoggingContext(url); + return ssf; + + } TrustManager[] tms = getTrustManagers( certStoreRootDirParam, @@ -129,6 +149,9 @@ public class SSLUtils { ssf = ctx.getSocketFactory(); // store SSLSocketFactory sslSocketFactories.put(url, ssf); + + checkMoaSigLoggingContext(url); + return ssf; } |