Skip to content

Conversation

@madhav165
Copy link
Collaborator

@madhav165 madhav165 commented Nov 3, 2025

✨ Feature / Enhancement PR

πŸ”— Epic / Issue

Link to the epic or parent issue:
Closes #1278, #1287, #1364


πŸš€ Summary (1-2 sentences)

Adds first-class support for self-signed TLS by allowing users to upload a custom CA certificate. The CA is wired through gateway create/update flows, health checks, and tool calls, with UI-side file validation and updated docs.


πŸ§ͺ How to Test This Feature

Quick Setup

  1. Get your CA certificate file - If your MCP server uses a self-signed certificate, you'll need the CA certificate file (usually named something like cert.pem, ca.pem, ca.crt, or rootCA.pem)

  2. Open the MCP Gateway Admin Panel - Navigate to your gateway instance and log in as an admin

Testing Steps

Step 1: Add a New Gateway with CA Certificate

  1. Go to Admin β†’ Gateways tab
  2. Click Add Gateway
  3. Fill in your server details:
    • Name: My Test Server
    • URL: https://your-mcp-server.example.com (must be HTTPS)
  4. Scroll to the CA Certificate section
  5. Drag your certificate file (.pem, .crt, .cer, or .cert) into the upload area, or click to browse
  6. You should see a green checkmark: βœ… "All certificates validated successfully!"
  7. Click Save

Step 2: Verify the Connection Works

  1. After saving, the gateway should show as "Active" or "Reachable"
  2. Go to the Tools tab
  3. You should see tools from your newly added gateway listed
  4. Try invoking one of the tools to confirm it works

Step 3: (Optional) Test Multiple Certificate Files
If you have a certificate chain (root + intermediate CAs):

  1. Select multiple certificate files when uploading
  2. The system will automatically order and combine them
  3. You'll see each file validated individually

What You Should See

βœ… Success indicators:

  • Green checkmark after upload
  • Gateway shows as connected/reachable
  • Tools are discovered from the server
  • Tool invocations work without SSL errors

❌ If something's wrong:

  • Red X with error message (check file format or size)
  • Gateway shows as unreachable (check URL or certificate)

Need Help?

If you encounter issues:

  1. Check that your certificate file is in PEM format
  2. Verify the URL matches your server's certificate CN/SAN
  3. Ensure the file is under 10MB
  4. See the full documentation at: docs/docs/manage/self-signed-certificates.md

πŸ§ͺ Checks

  • make lint passes
  • make test passes
  • CHANGELOG updated (if user-facing)
  • Documentation added (docs/docs/manage/self-signed-certificates.md)

Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
madhav165 and others added 22 commits November 8, 2025 21:41
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
Signed-off-by: Madhav Kandukuri <[email protected]>
- Fix imports: mcpgateway.models -> mcpgateway.common.models
- Add missing ToolHookType import
- Update plugin manager API: tool_pre_invoke -> invoke_hook with ToolHookType
- Update plugin manager API: tool_post_invoke -> invoke_hook with ToolHookType
- Update HttpHeaderPayload: headers -> root parameter
- Create alembic merge migration for CA cert and observability heads
- Apply pre-commit formatting fixes (trailing whitespace, tabs, encoding pragma)

Signed-off-by: Mihai Criveti <[email protected]>
Signed-off-by: Mihai Criveti <[email protected]>
@crivetimihai crivetimihai force-pushed the fix-for-self-signed-cert branch from 7743e2a to 7d439f4 Compare November 8, 2025 22:02
@crivetimihai crivetimihai removed the request for review from kevalmahajan November 8, 2025 22:23
Signed-off-by: Mihai Criveti <[email protected]>
@crivetimihai crivetimihai merged commit 2821907 into main Nov 8, 2025
40 of 42 checks passed
@crivetimihai crivetimihai deleted the fix-for-self-signed-cert branch November 8, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants