Function pact_mock_server::start_tls_mock_server[][src]

pub fn start_tls_mock_server(
    id: String,
    pact: Box<dyn Pact>,
    addr: SocketAddr,
    tls: &ServerConfig
) -> Result<i32, String>
Expand description

Starts a TLS mock server with the given ID, pact and port number. The ID needs to be unique. A port number of 0 will result in an auto-allocated port by the operating system. Returns the port that the mock server is running on wrapped in a Result.

  • id - Unique ID for the mock server.
  • pact - Pact model to use for the mock server.
  • addr - Socket address that the server should listen on.
  • tls - TLS config.

Errors

An error with a message will be returned in the following conditions:

  • If a mock server is not able to be started