@@ -59,6 +59,7 @@ ChargePoint::ChargePoint(const std::map<int32_t, int32_t>& evse_connector_struct
59
59
registration_status(RegistrationStatusEnum::Rejected),
60
60
network_configuration_priority(0 ),
61
61
disable_automatic_websocket_reconnects(false ),
62
+ skip_invalid_csms_certificate_notifications(false ),
62
63
reset_scheduled(false ),
63
64
reset_scheduled_evseids{},
64
65
firmware_status (FirmwareStatusEnum::Idle),
@@ -713,6 +714,9 @@ void ChargePoint::init_websocket() {
713
714
this ->init_certificate_expiration_check_timers (); // re-init as timers are stopped on disconnect
714
715
}
715
716
this ->time_disconnected = std::chrono::time_point<std::chrono::steady_clock>();
717
+
718
+ // We have a connection again so next time it fails we should send the notification again
719
+ this ->skip_invalid_csms_certificate_notifications = false ;
716
720
});
717
721
718
722
this ->websocket ->register_disconnected_callback ([this ]() {
@@ -749,8 +753,13 @@ void ChargePoint::init_websocket() {
749
753
this ->websocket ->register_connection_failed_callback ([this ](ConnectionFailedReason reason) {
750
754
switch (reason) {
751
755
case ConnectionFailedReason::InvalidCSMSCertificate:
752
- this ->security_event_notification_req (CiString<50 >(ocpp::security_events::INVALIDCSMSCERTIFICATE),
753
- std::nullopt, true , true );
756
+ if (!this ->skip_invalid_csms_certificate_notifications ) {
757
+ this ->security_event_notification_req (CiString<50 >(ocpp::security_events::INVALIDCSMSCERTIFICATE),
758
+ std::nullopt, true , true );
759
+ this ->skip_invalid_csms_certificate_notifications = true ;
760
+ } else {
761
+ EVLOG_info << " Skipping InvalidCsmsCertificate SecurityEvent since it has been sent already" ;
762
+ }
754
763
break ;
755
764
}
756
765
});
0 commit comments