Module: SwarmSDK::McpSslPatch

Defined in:
lib/swarm_sdk/ruby_llm_patches/mcp_ssl_patch.rb,
lib/swarm_sdk/ruby_llm_patches/mcp_ssl_patch.rb,
lib/swarm_sdk/ruby_llm_patches/mcp_ssl_patch.rb

Overview

Module-level SSL configuration for MCP HTTPX connections

Set ssl_options before creating MCP clients. The patched HTTPX methods read from this accessor to configure SSL on every connection.

Examples:

Default (validates cert chain, skips CRL)

McpSslPatch.ssl_options #=> { verify_mode: OpenSSL::SSL::VERIFY_PEER }

Disable SSL verification (local dev only)

McpSslPatch.ssl_options = { verify_mode: OpenSSL::SSL::VERIFY_NONE }

Defined Under Namespace

Modules: SseSslPatch, StreamableHttpSslPatch

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.ssl_optionsHash

Returns SSL options hash passed to HTTPX .with(ssl: …).

Returns:

  • (Hash)

    SSL options hash passed to HTTPX .with(ssl: …)



42
43
44
# File 'lib/swarm_sdk/ruby_llm_patches/mcp_ssl_patch.rb', line 42

def ssl_options
  @ssl_options
end

Class Method Details

.reset_connection!void

This method returns an undefined value.

Clear the thread-local HTTPX connection cache

Must be called after changing ssl_options so that HTTPClient.build_connection runs again with the updated options.



50
51
52
# File 'lib/swarm_sdk/ruby_llm_patches/mcp_ssl_patch.rb', line 50

def reset_connection!
  Thread.current[:ruby_llm_mcp_client_connection] = nil
end