Package jp.cssj.cti2

Class TLSPolicy

java.lang.Object
jp.cssj.cti2.TLSPolicy

public final class TLSPolicy extends Object
Controls whether to verify the server certificate.

Verification is enabled by default. Previously, verification was disabled by default, and the setting was named jp.cssj.driver.tls.trust (default true)—the name and meaning were reversed. "Trust" meant "accept anything."

The new name is INSECURE (jp.cssj.driver.tls.insecure), with a default of false (verification enabled). Set it to true only when connecting to a test server that uses a self-signed certificate.

Precedence

If the new name is specified, only that setting is used. The legacy name is checked only when the new name is absent, and true disables verification. insecure=false is never overridden by true under the legacy name.

Different meanings for CTIP and REST

With insecure=true, CTIP accepts anything. REST trusts certificate chains containing only one certificate and uses normal verification for all other chains (HttpClient's TrustSelfSignedStrategy). Both are workarounds for testing and must not be used in production.

  • Field Details

    • INSECURE

      public static final String INSECURE
      Whether to skip server certificate verification. Defaults to false (verification enabled).
      See Also:
    • LEGACY_TRUST

      @Deprecated public static final String LEGACY_TRUST
      Deprecated.
      The legacy name. It meant "accept anything," which was the opposite of what the name suggested.
      See Also:
  • Method Details

    • isInsecure

      public static boolean isInsecure()
      Returns whether to skip server certificate verification.