Skip to content

feat: add admin setting to bypass SSL certificate validation for Outlook calendar#3191

Merged
jeanfbrito merged 5 commits intodevfrom
outlook-toggle
Feb 5, 2026
Merged

feat: add admin setting to bypass SSL certificate validation for Outlook calendar#3191
jeanfbrito merged 5 commits intodevfrom
outlook-toggle

Conversation

@jeanfbrito
Copy link
Collaborator

@jeanfbrito jeanfbrito commented Feb 5, 2026

Summary

  • Adds allowInsecureOutlookConnections admin setting for air-gapped environments where Exchange servers use self-signed or internal CA certificates
  • Optimizes HTTPS agent reuse across sync requests

Configuration

Admins can enable this via overridden-settings.json:

{
  "allowInsecureOutlookConnections": true
}

File locations:

  • Windows: %APPDATA%/Rocket.Chat/overridden-settings.json
  • macOS: ~/Library/Application Support/Rocket.Chat/overridden-settings.json
  • Linux: ~/.config/Rocket.Chat/overridden-settings.json

CORE-1363

Summary by CodeRabbit

  • New Features

    • Added support for connecting to Outlook calendar in air-gapped and insecure network environments (e.g., networks with self-signed or internal certificates). Configuration available via settings.
  • Chores

    • Updated version to 4.12.1-alpha.2.
    • Applied dependency patch updates.

…ook calendar

Add `allowInsecureOutlookConnections` setting for air-gapped environments
where Exchange servers use self-signed or internal CA certificates.

Configurable via overridden-settings.json:
{ "allowInsecureOutlookConnections": true }

Changes:
- Add new reducer for the setting (defaults to false)
- Apply setting to both Exchange (XhrApi) and Rocket.Chat (axios) connections
- Reuse single HTTPS agent per sync for better performance
- Fix missing await on createEventOnRocketChatServer call
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Walkthrough

Adds support for insecure HTTPS connections (bypassing SSL certificate validation) for Outlook calendar integrations through an optional allowInsecureOutlookConnections flag, managed via Redux state and propagated through API calls using custom HTTPS agents.

Changes

Cohort / File(s) Summary
Outlook Event Fetching
src/outlookCalendar/getOutlookEvents.ts
Added optional allowInsecure parameter that disables SSL certificate validation by setting rejectUnauthorized: false on XhrApi instantiation when enabled.
Rocket.Chat Sync & API Integration
src/outlookCalendar/ipc.ts
Extended Rocket.Chat API helpers (listEventsFromRocketChatServer, createEventOnRocketChatServer, updateEventOnRocketChatServer, deleteEventOnRocketChatServer) to accept optional httpsAgent parameter. Added createInsecureHttpsAgent() helper. Updated syncEventsWithRocketChatServer to accept allowInsecure flag, create shared agent when needed, and propagate through API calls. Updated maybeSyncEvents and startOutlookCalendarUrlHandler to read allowInsecureOutlookConnections from persisted state and forward to sync logic.
Redux State Management
src/outlookCalendar/reducers/allowInsecureOutlookConnections.ts, src/store/rootReducer.ts
New reducer managing boolean allowInsecureOutlookConnections state (default false), responding to APP_SETTINGS_LOADED action. Integrated into root reducer for RootState persistence.
Action & Payload Types
src/app/actions.ts
Added OverrideOnlySettings type with optional allowInsecureOutlookConnections property. Extended APP_SETTINGS_LOADED payload type to include override settings.
Settings Initialization
src/app/main/data.ts
Merges user and app override settings; computes allowInsecureOutlookConnections (true if value is boolean true or string 'true' case-insensitive) and includes in APP_SETTINGS_LOADED payload.
Dependencies
package.json
Version bumped to 4.12.1-alpha.2. Added patched @ewsjs/xhr dependency to support custom HTTPS agent configurations.

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant Redux as Redux Store
    participant Sync as Sync Process
    participant Outlook as Outlook API
    participant RC as Rocket.Chat Server

    App->>App: Load merged override settings
    App->>App: Compute allowInsecureOutlookConnections
    App->>Redux: Dispatch APP_SETTINGS_LOADED<br/>(with allowInsecureOutlookConnections)
    Redux->>Redux: Update allowInsecureOutlookConnections state
    
    Note over App,Redux: Settings persisted in Redux
    
    App->>Sync: Trigger sync (allowInsecureOutlookConnections flag)
    alt allowInsecure = true
        Sync->>Sync: Create insecure httpsAgent<br/>(rejectUnauthorized: false)
    else allowInsecure = false
        Sync->>Sync: Use default https agent
    end
    
    Sync->>Outlook: getOutlookEvents(allowInsecure)
    Outlook->>Outlook: Configure XhrApi with SSL setting
    Outlook-->>Sync: Return appointments
    
    Sync->>RC: syncEvents(httpsAgent)
    RC-->>Sync: Sync complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Through Redux we hop, setting flags so grand,
SSL walls bypass in air-gapped land,
Outlook and Rocket.Chat now sync with care,
With agents and patches floating through the air! 🛡️

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the changeset: adding a new admin setting to bypass SSL certificate validation for Outlook calendar connections, which is the primary functional change across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch outlook-toggle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/outlookCalendar/ipc.ts`:
- Line 1: The flag allowInsecureOutlookConnections is intended for Outlook only
but the insecure httpsAgent (rejectUnauthorized: false) is currently being
passed into Rocket.Chat API requests too; remove the httpsAgent plumbing from
any Rocket.Chat API calls (wherever httpsAgent is injected/forwarded into the
Rocket.Chat request code) so that only Outlook-related code uses
allowInsecureOutlookConnections, or alternatively introduce a separate explicit
config (e.g., allowInsecureRocketChatConnections) and gate the httpsAgent behind
that new setting; update usages of httpsAgent, the checks against
allowInsecureOutlookConnections, and any functions that build/forward the agent
so Rocket.Chat requests no longer inherit the Outlook-only insecure agent unless
a new explicit setting is provided.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

pierre-lehnen-rc and others added 3 commits February 5, 2026 14:31
The setting was being persisted to config.json, which meant once set to
true it would stay true even after removing from overridden-settings.json.

Changes:
- Remove from PersistableValues type and migrations
- Remove from selectPersistableValues selector
- Explicitly read from override files on each app start
- Accept case-insensitive "true" values for robustness
- Always defaults to false when key is missing

This ensures admins have full control over the setting in air-gapped
environments where remote debugging is not possible.
@jeanfbrito jeanfbrito merged commit 1b523fe into dev Feb 5, 2026
8 checks passed
@jeanfbrito jeanfbrito deleted the outlook-toggle branch February 5, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants