OF-3266: Fix wrong getter used in setAcceptSelfSignedCertificates
Use acceptSelfSignedCertificates() instead of verifyCertificateValidity() to determine the previous value.
The old implementation compared unrelated settings, which could prevent required restarts or trigger unnecessary ones.
(cherry picked from commit cdaee01122339179099387f513442efafda3be9f)