Package org.mockserver.socket.tls
Class ProxySetupInfo
java.lang.Object
org.mockserver.socket.tls.ProxySetupInfo
Single source of truth for the copy-paste proxy-setup information surfaced both in the startup log
(see
LifeCycle.startedServer) and the /mockserver/proxyConfiguration control-plane
endpoint. It carries the active Certificate Authority certificate path, the HTTPS proxy URL, and the
OS-specific environment-variable blocks a client needs to route TLS traffic through MockServer and
trust its CA.
This is a pure value holder — constructing it has no logging or filesystem side effects. The CA file
is materialised separately via KeyAndCertificateFactory.writeCertificateAuthorityToDisk() and
its absolute path passed in.
- Author:
- jamesdbloom
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProxySetupInfo(String caCertificatePath, List<Integer> ports, Configuration configuration, String osName) -
Method Summary
Modifier and TypeMethodDescriptionAssembles the full human-readable copy-paste block for the current OS, selecting the PowerShell block on Windows and the Unix block otherwise, and appending the security warning when the public baked-in CA is in effect.booleanPowerShell environment-variable assignments equivalent tounixEnvBlock().Bash / zsh environment-variable exports for routing TLS traffic through MockServer and trusting its CA.booleanwarning()
-
Field Details
-
DEFAULT_CA_WARNING
- See Also:
-
-
Constructor Details
-
ProxySetupInfo
public ProxySetupInfo(String caCertificatePath, List<Integer> ports, Configuration configuration, String osName) - Parameters:
caCertificatePath- absolute path of the materialised active CA certificate PEMports- the bound port(s); the first is used for the proxy URLconfiguration- the active configuration (used to determine the CA in effect)osName- the OS name (e.g.System.getProperty("os.name")) used to select between the Unix and PowerShell environment-variable blocks
-
-
Method Details
-
caCertificatePath
-
httpsProxyUrl
-
usingDefaultCa
public boolean usingDefaultCa() -
warning
- Returns:
- the security warning text when the public baked-in CA is in effect, otherwise
null
-
isWindows
public boolean isWindows() -
unixEnvBlock
Bash / zsh environment-variable exports for routing TLS traffic through MockServer and trusting its CA. -
powershellEnvBlock
PowerShell environment-variable assignments equivalent tounixEnvBlock(). -
copyPasteText
Assembles the full human-readable copy-paste block for the current OS, selecting the PowerShell block on Windows and the Unix block otherwise, and appending the security warning when the public baked-in CA is in effect.
-