OneUptime probe doesn't work with HTTPS proxies in restricted network environments #397

Closed
opened 2026-04-05 16:19:34 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @listellm on 8/29/2025

Problem Summary

The OneUptime probe fails to work properly when deployed in restricted network environments that require all internet access to go through an HTTPS proxy. Despite setting all the correct proxy
environment variables, the probe cannot establish connections to oneuptime.com.

Environment Details

  • Deployment: Kubernetes cluster with restricted internet access
  • Proxy: Squid proxy (all external traffic must go through proxy)
  • Network Policy: No direct internet access allowed
  • OneUptime probe version: Latest Docker image from docker.io/oneuptime/probe

Current Configuration

All proxy environment variables are correctly set in the container:

env:
  - name: HTTP_PROXY
    value: "http://proxy.example.com:3128"
  - name: HTTPS_PROXY
    value: "http://proxy.example.com:3128"
  - name: http_proxy
    value: "http://proxy.example.com:3128"
  - name: https_proxy
    value: "http://proxy.example.com:3128"
  - name: GLOBAL_AGENT_HTTPS_PROXY
    value: "http://proxy.example.com:3128"
  - name: NODE_TLS_REJECT_UNAUTHORIZED
    value: "0"

Expected Behavior

For HTTPS proxy requests, the application should:
1. Send CONNECT oneuptime.com:443 to establish a tunnel
2. Once tunnel is established, send HTTP requests through the tunnel
3. Proxy logs should show 200 CONNECT requests

Actual Behavior

The application attempts direct HTTPS POST requests instead of using proper proxy tunneling:
1. Makes direct POST https://oneuptime.com/probe-ingest/monitor/list requests
2. Proxy rejects these with 503 Service Unavailable
3. Probe logs show SSL handshake errors: ERR_SECURE_CONNECT_FAIL

Evidence from Proxy Logs

{"method":"POST","url":"https://oneuptime.com/probe-ingest/monitor/list","status":503}
{"method":"POST","url":"https://oneuptime.com/probe-ingest/monitor-test/list","status":503}
{"method":"POST","url":"https://oneuptime.com/probe-ingest/alive","status":503}

Expected vs Actual Proxy Logs

Expected (working):
{"method":"CONNECT","url":"oneuptime.com:443","status":200}

Actual (failing):
{"method":"POST","url":"https://oneuptime.com/probe-ingest/monitor/list","status":503}

Root Cause Analysis

The OneUptime probe's HTTP client (likely axios) doesn't properly implement HTTPS proxy tunneling despite environment variables being set. Many Node.js HTTP clients require explicit proxy agent
configuration to work with HTTPS proxies.

Suggested Solution

Use a proper HTTP proxy agent library such as:
- https://www.npmjs.com/package/https-proxy-agent
- https://www.npmjs.com/package/global-agent
- Configure axios with explicit proxy agent support

Example implementation:
import { HttpsProxyAgent } from 'https-proxy-agent';

const proxyUrl = process.env.HTTPS_PROXY;
const agent = proxyUrl ? new HttpsProxyAgent(proxyUrl) : undefined;

// Configure axios with proxy agent
axios.defaults.httpsAgent = agent;

Impact

This issue prevents OneUptime probe from being used in:
- Corporate networks with proxy requirements
- Kubernetes clusters with restricted egress policies
- Any environment requiring HTTP proxy for internet access
- Security-conscious deployments with network isolation

Workaround

Currently no viable workaround exists for restricted network environments where direct internet access is not permitted.

Additional Context

- Other services in the same environment work fine with identical proxy configuration
- The proxy server is functioning correctly (confirmed with other applications)
- All proxy environment variables are properly set and visible in the container
- Issue is specific to HTTPS requests to oneuptime.com endpoints

Request

Please implement proper HTTPS proxy support in the OneUptime probe to enable deployment in restricted network environments.A
*Originally created by @listellm on 8/29/2025* ## Problem Summary The OneUptime probe fails to work properly when deployed in restricted network environments that require all internet access to go through an HTTPS proxy. Despite setting all the correct proxy environment variables, the probe cannot establish connections to `oneuptime.com`. ## Environment Details - **Deployment**: Kubernetes cluster with restricted internet access - **Proxy**: Squid proxy (all external traffic must go through proxy) - **Network Policy**: No direct internet access allowed - **OneUptime probe version**: Latest Docker image from `docker.io/oneuptime/probe` ## Current Configuration All proxy environment variables are correctly set in the container: ```yaml env: - name: HTTP_PROXY value: "http://proxy.example.com:3128" - name: HTTPS_PROXY value: "http://proxy.example.com:3128" - name: http_proxy value: "http://proxy.example.com:3128" - name: https_proxy value: "http://proxy.example.com:3128" - name: GLOBAL_AGENT_HTTPS_PROXY value: "http://proxy.example.com:3128" - name: NODE_TLS_REJECT_UNAUTHORIZED value: "0" Expected Behavior For HTTPS proxy requests, the application should: 1. Send CONNECT oneuptime.com:443 to establish a tunnel 2. Once tunnel is established, send HTTP requests through the tunnel 3. Proxy logs should show 200 CONNECT requests Actual Behavior The application attempts direct HTTPS POST requests instead of using proper proxy tunneling: 1. Makes direct POST https://oneuptime.com/probe-ingest/monitor/list requests 2. Proxy rejects these with 503 Service Unavailable 3. Probe logs show SSL handshake errors: ERR_SECURE_CONNECT_FAIL Evidence from Proxy Logs {"method":"POST","url":"https://oneuptime.com/probe-ingest/monitor/list","status":503} {"method":"POST","url":"https://oneuptime.com/probe-ingest/monitor-test/list","status":503} {"method":"POST","url":"https://oneuptime.com/probe-ingest/alive","status":503} Expected vs Actual Proxy Logs Expected (working): {"method":"CONNECT","url":"oneuptime.com:443","status":200} Actual (failing): {"method":"POST","url":"https://oneuptime.com/probe-ingest/monitor/list","status":503} Root Cause Analysis The OneUptime probe's HTTP client (likely axios) doesn't properly implement HTTPS proxy tunneling despite environment variables being set. Many Node.js HTTP clients require explicit proxy agent configuration to work with HTTPS proxies. Suggested Solution Use a proper HTTP proxy agent library such as: - https://www.npmjs.com/package/https-proxy-agent - https://www.npmjs.com/package/global-agent - Configure axios with explicit proxy agent support Example implementation: import { HttpsProxyAgent } from 'https-proxy-agent'; const proxyUrl = process.env.HTTPS_PROXY; const agent = proxyUrl ? new HttpsProxyAgent(proxyUrl) : undefined; // Configure axios with proxy agent axios.defaults.httpsAgent = agent; Impact This issue prevents OneUptime probe from being used in: - Corporate networks with proxy requirements - Kubernetes clusters with restricted egress policies - Any environment requiring HTTP proxy for internet access - Security-conscious deployments with network isolation Workaround Currently no viable workaround exists for restricted network environments where direct internet access is not permitted. Additional Context - Other services in the same environment work fine with identical proxy configuration - The proxy server is functioning correctly (confirmed with other applications) - All proxy environment variables are properly set and visible in the container - Issue is specific to HTTPS requests to oneuptime.com endpoints Request Please implement proper HTTPS proxy support in the OneUptime probe to enable deployment in restricted network environments.A
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#397