louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
59.74k stars 5.34k forks source link

'socket.getPeerCertificate is not a function' on Uptime Kuma v1.23.13 using podman #4873

Open ericclose opened 4 months ago

ericclose commented 4 months ago

πŸ“‘ I have found these related issues/pull requests

I unable find any related issues

πŸ›‘οΈ Security Policy

Description

Uptime Kuma v1.23.13 (podman deployment) always displays the error message "socket.getPeerCertificate is not a function," and all tested websites are down.

πŸ‘Ÿ Reproduction steps

Running Uptime Kuma v1.23.13 using docker

πŸ‘€ Expected behavior

It should work as normal...

πŸ˜“ Actual Behavior

socket.getPeerCertificate is not a function

🐻 Uptime-Kuma Version

1.23.13

πŸ’» Operating System and Arch

Fedora 40

🌐 Browser

Google Chrome 126.0.6478.61

πŸ–₯️ Deployment Environment

πŸ“ Relevant log output

2024-06-21T08:35:30+08:00 [MONITOR] WARN: Monitor #1 'ε……η”΅ζ‘©-后台PCη«―': Pending: socket.getPeerCertificate is not a function | Max retries: 3 | Retry: 2 | Retry Interval: 60 seconds | Type: http
2024-06-21T08:36:32+08:00 [MONITOR] WARN: Monitor #1 'ε……η”΅ζ‘©-后台PCη«―': Pending: socket.getPeerCertificate is not a function | Max retries: 3 | Retry: 3 | Retry Interval: 60 seconds | Type: http
2024-06-21T08:37:34+08:00 [MONITOR] WARN: Monitor #1 'ε……η”΅ζ‘©-后台PCη«―': Failing: socket.getPeerCertificate is not a function | Interval: 60 seconds | Type: http | Down Count: 0 | Resend Interval: 0
2024-06-21T08:37:40+08:00 [MONITOR] INFO: Get Monitor: 1 User ID: 1
2024-06-21T08:37:57+08:00 [MONITOR] INFO: Get Monitor: 1 User ID: 1
2024-06-21T08:38:01+08:00 [MANAGE] INFO: Resume Monitor: 1 User ID: 1
2024-06-21T08:38:01+08:00 [MONITOR] INFO: Get Monitor: 1 User ID: 1
2024-06-21T08:38:02+08:00 [MONITOR] WARN: Monitor #1 'ε……η”΅ζ‘©-后台PCη«―': Pending: socket.getPeerCertificate is not a function | Max retries: 3 | Retry: 1 | Retry Interval: 60 seconds | Type: http
2024-06-21T08:38:13+08:00 [MONITOR] INFO: Get Monitor: 1 User ID: 1
2024-06-21T08:38:21+08:00 [MANAGE] INFO: Resume Monitor: 1 User ID: 1
2024-06-21T08:38:21+08:00 [MONITOR] INFO: Get Monitor: 1 User ID: 1
2024-06-21T08:38:23+08:00 [MONITOR] WARN: Monitor #1 'ε……η”΅ζ‘©-后台PCη«―': Pending: socket.getPeerCertificate is not a function | Max retries: 3 | Retry: 1 | Retry Interval: 60 seconds | Type: http
2024-06-21T08:39:25+08:00 [MONITOR] WARN: Monitor #1 'ε……η”΅ζ‘©-后台PCη«―': Pending: socket.getPeerCertificate is not a function | Max retries: 3 | Retry: 2 | Retry Interval: 60 seconds | Type: http
onlyc0302 commented 4 months ago

I also encountered the same problem

Uptime-Kuma Version

1.23.13

πŸ’» Operating System and Arch

Ubuntu 22.04.4

Deployment Environment

my docker-compose.yml

name: uptime
services:
  uptime-kuma:
    image: louislam/uptime-kuma:1.23.13
    restart: always
    ports:
      - 3001:3001
    volumes:
      - ./data:/app/data
    environment:
      - https_proxy=http://172.x.x.x:7890
      - http_proxy=http://172.x.x.x:7890

reproduce setp

  1. add https_proxy,http_proxy
  2. add https request I found that when I added http proxy and https proxy variables, this error would occur when detecting https requests. However, this error would not occur if I only detected http protocol requests.

πŸ“Relevant log output

2024-07-11T16:43:07+08:00 [MONITOR] WARN: Monitor #1 'server-api': Pending: socket.getPeerCertificate is not a function | Max retries: 10 | Retry: 2 | Retry Interval: 20 seconds | Type: http
2024-07-11T16:43:27+08:00 [MONITOR] WARN: Monitor #1 'server-api': Pending: socket.getPeerCertificate is not a function | Max retries: 10 | Retry: 3 | Retry Interval: 20 seconds | Type: http

images

image
rmdes commented 3 months ago

same here when used in conjunction with self-signed corporate certificates

SeaLife commented 3 months ago

This is already happening on 1.23.11 but will not cause the Monitor to go down:

kuma_1  | 2024-08-01T15:26:28+02:00 [MONITOR] ERROR: Caught error
kuma_1  | 2024-08-01T15:26:28+02:00 [MONITOR] ERROR: res.request.res.socket.getPeerCertificate is not a function
kuma_1  | 2024-08-01T15:26:28+02:00 [MONITOR] ERROR: Caught error
kuma_1  | 2024-08-01T15:26:28+02:00 [MONITOR] ERROR: res.request.res.socket.getPeerCertificate is not a function
kuma_1  | 2024-08-01T15:26:29+02:00 [MONITOR] ERROR: Caught error
kuma_1  | 2024-08-01T15:26:29+02:00 [MONITOR] ERROR: res.request.res.socket.getPeerCertificate is not a function
kuma_1  | 2024-08-01T15:26:30+02:00 [MONITOR] ERROR: Caught error
kuma_1  | 2024-08-01T15:26:30+02:00 [MONITOR] ERROR: res.request.res.socket.getPeerCertificate is not a function
kuma_1  | 2024-08-01T15:26:30+02:00 [MONITOR] ERROR: Caught error
kuma_1  | 2024-08-01T15:26:31+02:00 [MONITOR] ERROR: res.request.res.socket.getPeerCertificate is not a function
kuma_1  | 2024-08-01T15:26:31+02:00 [MONITOR] ERROR: Caught error
kuma_1  | 2024-08-01T15:26:31+02:00 [MONITOR] ERROR: res.request.res.socket.getPeerCertificate is not a function

In the newest version 1.23.13 this will cause the monitor to go down:

kuma_1  | 2024-08-01T15:22:31+02:00 [MONITOR] WARN: Monitor #19 'xxxx (xxxx)': Failing: socket.getPeerCertificate is not a function | Interval: 60 seconds | Type: http | Down Count: 0 | Resend Interval: 0

Also we got another issue which prevents us from using 1.23.12, so we'r sticking to 1.23.11 probably (this may be fixed in 1.23.13 but as we cant use that, we tried 1.23.12 instead):

kuma_1  | 2024-08-01T15:23:46+02:00 [MONITOR] WARN: Monitor #52 'xxxx (xxxx)': Failing: Cannot set properties of undefined (setting 'valid') | Interval: 60 seconds | Type: http | Down Count: 0 | Resend Interval: 0

We tried upgrading as none of our Monitors is displaying the certificate expiry time. Which we hoped is fixed in 1.23.13 but is probably not. Maybe a issue with the bundled node version in the docker container?

//EDIT: We'r also using a corporate certificate added using "NODE_EXTRA_CA_CERTS"

amrap030 commented 1 month ago

I have the same problem using corporate certificates.

dineshbabu179 commented 1 month ago

+1