EventDestination: Implement VerifyCertificate

VerifyCertificate is a property on the Redfish EventDestination schema.
It specifies that this property is:
``` An indication of whether the service will verify the certificate of
the server referenced by the `Destination` property prior to sending the
event ```

To keep prior behavior, and to ensure behavior that's secure by default,
if the user omits the property, it is assumed to be true.  This property
is also persisted and restored.

Tested:
Redfish-Event-Listener succeeds with the following procedure
Start Redfish-Event-Listener
PATCH /redfish/v1/Subscriptions/<subid> VerifyCertificate: false
POST /redfish/v1/EventService/Actions/EventService.SubmitTestEvent

Redfish-Event-Listener then hits an internal error, due to an encoding
compatibility unrelated to this patch, but is documented in the receiver
[1]

POST of a subscription with VerifyCertificate: false set, succeeds.

[1] https://github.com/DMTF/Redfish-Event-Listener/blob/6f3f98beafc89fa9bbf86aa4f8cac6c1987390fb/RedfishEventListener_v1.py#L61

Change-Id: I27e0a3fe87b4dbd0432bfaa22ebf593c3955db11
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
index aebc282..dab53fe 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -278,6 +278,7 @@
         }
         std::string destUrl;
         std::string protocol;
+        std::optional<bool> verifyCertificate;
         std::optional<std::string> context;
         std::optional<std::string> subscriptionType;
         std::optional<std::string> eventFormatType2;
@@ -294,7 +295,8 @@
                 "EventFormatType", eventFormatType2, "HttpHeaders", headers,
                 "RegistryPrefixes", regPrefixes, "MessageIds", msgIds,
                 "DeliveryRetryPolicy", retryPolicy, "MetricReportDefinitions",
-                mrdJsonArray, "ResourceTypes", resTypes))
+                mrdJsonArray, "ResourceTypes", resTypes, "VerifyCertificate",
+                verifyCertificate))
         {
             return;
         }
@@ -433,6 +435,11 @@
         }
         subValue->protocol = protocol;
 
+        if (verifyCertificate)
+        {
+            subValue->verifyCertificate = *verifyCertificate;
+        }
+
         if (eventFormatType2)
         {
             if (std::ranges::find(supportedEvtFormatTypes, *eventFormatType2) ==
@@ -672,6 +679,8 @@
 
         asyncResp->res.jsonValue["MessageIds"] = subValue->registryMsgIds;
         asyncResp->res.jsonValue["DeliveryRetryPolicy"] = subValue->retryPolicy;
+        asyncResp->res.jsonValue["VerifyCertificate"] =
+            subValue->verifyCertificate;
 
         nlohmann::json::array_t mrdJsonArray;
         for (const auto& mdrUri : subValue->metricReportDefinitions)
@@ -706,9 +715,11 @@
 
         std::optional<std::string> context;
         std::optional<std::string> retryPolicy;
+        std::optional<bool> verifyCertificate;
         std::optional<std::vector<nlohmann::json::object_t>> headers;
 
         if (!json_util::readJsonPatch(req, asyncResp->res, "Context", context,
+                                      "VerifyCertificate", verifyCertificate,
                                       "DeliveryRetryPolicy", retryPolicy,
                                       "HttpHeaders", headers))
         {
@@ -754,6 +765,11 @@
             subValue->retryPolicy = *retryPolicy;
         }
 
+        if (verifyCertificate)
+        {
+            subValue->verifyCertificate = *verifyCertificate;
+        }
+
         EventServiceManager::getInstance().updateSubscriptionData();
     });
     BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions/<str>/")