Class HostnameVerificationUtil
java.lang.Object
org.identityconnectors.framework.common.security.HostnameVerificationUtil
Single definition point for the hostname-verification opt-out system property shared by every
outbound TLS client of the connector framework.
By default, hostname verification is ON: outbound TLS connections verify that the peer
certificate matches the target host. Setting the PROP_NAME system property to
true (any case) or 1 skips certificate name checking only; certificate chain
validation against the configured trust store always remains in force. Call sites that honour
the opt-out report it through warnIfDisabled(Class), which emits a single WARN naming
the property, at most once per caller class per class loader.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns whether hostname verification is disabled by thePROP_NAMEsystem property.static voidwarnIfDisabled(Class<?> caller) Logs a WARN namingPROP_NAMEwhen the hostname-verification opt-out is active, stating that certificate chain validation remains in force.
-
Field Details
-
PROP_NAME
System property that, when set totrue(any case) or1, disables hostname verification for the framework's outbound TLS connections. The property never affects certificate chain validation.- See Also:
-
-
Method Details
-
isHostnameVerificationDisabled
public static boolean isHostnameVerificationDisabled()Returns whether hostname verification is disabled by thePROP_NAMEsystem property. The property is read on every call (no caching), so callers observe live changes to the property. This opt-out skips certificate name checking only; certificate chain validation is never skipped.- Returns:
- true when the property is set to
true(any case) or1; false when the property is unset,false, or any other value.
-
warnIfDisabled
Logs a WARN namingPROP_NAMEwhen the hostname-verification opt-out is active, stating that certificate chain validation remains in force. The warning is emitted at most once per caller class per class loader, on the first call that observes the opt-out active for that caller class. Nothing is logged while the opt-out is not active.- Parameters:
caller- class of the call site honouring the opt-out; used for log attribution and as the once-per-class-loader warning guard key. Must not be null.
-