diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-06-27 13:11:53 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-06-27 13:11:53 +0200 |
commit | a8e726382b0472ad030d7a579fe8d6878a216bd4 (patch) | |
tree | ceeb6bb09073da926c95230cb80a8ff156ea1481 /src/main/java/at/gv/egiz/moazs/msg/MsgClientFactory.java | |
parent | e2e77ed55687cb92c6f5a273995daf64dedef848 (diff) | |
download | moa-zs-a8e726382b0472ad030d7a579fe8d6878a216bd4.tar.gz moa-zs-a8e726382b0472ad030d7a579fe8d6878a216bd4.tar.bz2 moa-zs-a8e726382b0472ad030d7a579fe8d6878a216bd4.zip |
Fixes; SSL Client Auth Works!
- Switch to java 12 for now. Reason: Bug [1] in JDK 11 (up to
jdk-11+28) impairs SSLHandshake ("Unsupported Operation Exception"),
but was fixed in Java 12.
- Set HTTP policy to infinite.
- Fix key/truststore path resolution
- Fix NPE in ConfigUtil.merge
- Rearrange application.yaml to include two config profiles (one with
and one without SSL for the msg client).
- Add key material for testcases (Note: expires: May 2 14:47:08 2020 GMT)
- Update MsgClient Testcases
[1] https://bugs.openjdk.java.net/browse/JDK-8214098
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/msg/MsgClientFactory.java')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/msg/MsgClientFactory.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/msg/MsgClientFactory.java b/src/main/java/at/gv/egiz/moazs/msg/MsgClientFactory.java index d4cc9f1..071a243 100644 --- a/src/main/java/at/gv/egiz/moazs/msg/MsgClientFactory.java +++ b/src/main/java/at/gv/egiz/moazs/msg/MsgClientFactory.java @@ -4,6 +4,9 @@ import at.gv.egiz.moazs.util.FileUtils; import at.gv.egiz.moazs.util.SSLContextCreator; import at.gv.zustellung.app2mzs.xsd.ClientType; import at.gv.zustellung.app2mzs.xsd.KeyStoreType; +import com.sun.istack.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -14,6 +17,8 @@ import static at.gv.zustellung.app2mzs.xsd.KeyStoreType.keyStoreTypeBuilder; @Component public class MsgClientFactory { + private static final Logger log = LoggerFactory.getLogger(MsgClientFactory.class); + private final StoreSOAPBodyBinaryInRepositoryInterceptor storeResponseInterceptor; private final SSLContextCreator sslContextCreator; private final FileUtils fileUtils; @@ -47,10 +52,16 @@ public class MsgClientFactory { return new MsgClient(storeResponseInterceptor, params.getURL(), sslContext); } - private KeyStoreType resolveKeyStorePath(KeyStoreType store) { - return store == null ? null - : keyStoreTypeBuilder(store) - .withFileName(fileUtils.determinePath(store.getFileName())) + private KeyStoreType resolveKeyStorePath(@Nullable KeyStoreType store) { + + if (store == null) return null; + + var resolvedURI = "file:" + fileUtils.determinePath(store.getFileName()); + + log.trace("Resolved key store path from {} to {}.", store.getFileName(), resolvedURI); + + return keyStoreTypeBuilder(store) + .withFileName(resolvedURI) .build(); } |