|
16 | 16 | */ |
17 | 17 | package com.helger.phase4.incoming; |
18 | 18 |
|
| 19 | +import java.security.cert.X509Certificate; |
| 20 | + |
19 | 21 | import org.jspecify.annotations.NonNull; |
20 | 22 |
|
21 | 23 | import com.helger.annotation.Nonempty; |
|
27 | 29 | import com.helger.json.IJsonObject; |
28 | 30 | import com.helger.json.JsonArray; |
29 | 31 | import com.helger.json.JsonObject; |
| 32 | +import com.helger.security.certificate.CertificateHelper; |
30 | 33 |
|
31 | 34 | import jakarta.servlet.http.Cookie; |
32 | 35 |
|
@@ -66,6 +69,13 @@ public static IJsonObject getIncomingMetadataAsJson (@NonNull final IAS4Incoming |
66 | 69 | aMap.add ("RemotePort", aMessageMetadata.getRemotePort ()); |
67 | 70 | if (aMessageMetadata.hasRemoteUser ()) |
68 | 71 | aMap.add ("RemoteUser", aMessageMetadata.getRemoteUser ()); |
| 72 | + if (aMessageMetadata.hasRemoteTlsCerts ()) |
| 73 | + { |
| 74 | + final IJsonArray aArray = new JsonArray (); |
| 75 | + for (final X509Certificate aCert : aMessageMetadata.remoteTlsCerts ()) |
| 76 | + aArray.add (CertificateHelper.getPEMEncodedCertificate (aCert)); |
| 77 | + aMap.add ("RemoteTlsCerts", aArray); |
| 78 | + } |
69 | 79 | { |
70 | 80 | final IJsonArray aArray = new JsonArray (); |
71 | 81 | for (final Cookie aCookie : aMessageMetadata.cookies ()) |
@@ -101,6 +111,10 @@ public static IJsonObject getIncomingMetadataAsJson (@NonNull final IAS4Incoming |
101 | 111 | if (aArray.isNotEmpty ()) |
102 | 112 | aMap.add ("HttpHeaders", aArray); |
103 | 113 | } |
| 114 | + if (aMessageMetadata.getRequestMessageID () != null) |
| 115 | + aMap.add ("RequestMessageID", aMessageMetadata.getRequestMessageID ()); |
| 116 | + if (aMessageMetadata.hasResponseHttpStatusCode ()) |
| 117 | + aMap.add ("ResponseHttpStatusCode", aMessageMetadata.getResponseHttpStatusCode ()); |
104 | 118 | return aMap; |
105 | 119 | } |
106 | 120 | } |
0 commit comments