Class HostnameVerificationUtil

java.lang.Object
org.identityconnectors.framework.common.security.HostnameVerificationUtil

public final class HostnameVerificationUtil extends Object
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
    Modifier and Type
    Field
    Description
    static final String
    System property that, when set to true (any case) or 1, disables hostname verification for the framework's outbound TLS connections.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Returns whether hostname verification is disabled by the PROP_NAME system property.
    static void
    warnIfDisabled(Class<?> caller)
    Logs a WARN naming PROP_NAME when the hostname-verification opt-out is active, stating that certificate chain validation remains in force.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PROP_NAME

      public static final String PROP_NAME
      System property that, when set to true (any case) or 1, 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 the PROP_NAME system 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) or 1; false when the property is unset, false, or any other value.
    • warnIfDisabled

      public static void warnIfDisabled(Class<?> caller)
      Logs a WARN naming PROP_NAME when 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.