Class OpenSearchTlsSupport
java.lang.Object
ai.attackframework.tools.burp.utils.opensearch.OpenSearchTlsSupport
Shared TLS helpers for OpenSearch connectivity, pin import, and trust-mode enforcement.
The persisted TLS mode lives in RuntimeConfig. Imported pinned certificate material is
session-scoped and held only in SecureCredentialStore, similar to auth secrets.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SSLContextBuilds an SSL context that trusts only the currently imported pinned certificate.static StringReturns the effective OpenSearch TLS mode, honoring the insecure override property when set.static StringfailureTrustSummary(String baseUrl, String detail) Returns a user-facing trust summary for failed connections under the current mode.static booleanReturns whether pinned certificate material is currently loaded in session memory.importPinnedCertificate(Path path) Imports one X.509 certificate file and returns session-ready pin material.static booleanReturns whether the current TLS mode trusts all certificates insecurely.static booleanReturns whether the current TLS mode requires a pinned certificate.static booleanlooksLikeTrustFailure(String message) Returns true when the message looks like a TLS trust, pin, or hostname-verification failure.static StringReturns the loaded pinned certificate fingerprint, or blank when none is loaded.static StringsuccessTrustSummary(String baseUrl) Returns a user-facing trust summary for successful connections under the current mode.
-
Method Details
-
currentTlsMode
Returns the effective OpenSearch TLS mode, honoring the insecure override property when set. -
isInsecureMode
public static boolean isInsecureMode()Returns whether the current TLS mode trusts all certificates insecurely. -
isPinnedMode
public static boolean isPinnedMode()Returns whether the current TLS mode requires a pinned certificate. -
hasPinnedCertificate
public static boolean hasPinnedCertificate()Returns whether pinned certificate material is currently loaded in session memory. -
pinnedCertificateFingerprint
Returns the loaded pinned certificate fingerprint, or blank when none is loaded. -
importPinnedCertificate
public static SecureCredentialStore.PinnedTlsCertificate importPinnedCertificate(Path path) throws IOException, CertificateException Imports one X.509 certificate file and returns session-ready pin material.DER and PEM encodings are supported by the JCA certificate factory as long as the file contains a single X.509 certificate.
- Parameters:
path- source file chosen by the user- Returns:
- imported pin material
- Throws:
IOException- when the file cannot be readCertificateException- when the file does not contain a readable X.509 certificate
-
buildPinnedSslContext
Builds an SSL context that trusts only the currently imported pinned certificate.- Throws:
GeneralSecurityException
-
successTrustSummary
Returns a user-facing trust summary for successful connections under the current mode. -
failureTrustSummary
Returns a user-facing trust summary for failed connections under the current mode. -
looksLikeTrustFailure
Returns true when the message looks like a TLS trust, pin, or hostname-verification failure.
-