herenicknameH
Denoβ€’3y agoβ€’
1 reply
herenickname

Deno.serve() with SSL cert timeout

I have a very simple script that serves a /ping route.
After some time (randomly) it stalls and no new request goes through.

main.ts:
import { Hono } from 'https://deno.land/x/hono@v3.11.10/mod.ts'
import { basicAuth, logger } from 'https://deno.land/x/hono@v3.11.10/middleware.ts'

const app = new Hono()

app.use('*', logger())

app.get(
    '/ping',
    (c) => c.text('pong')
)

const cert = await Deno.readTextFile('/root/fullchain.pem')
const key = await Deno.readTextFile('/root/privkey.pem')

Deno.serve({ port: 443, cert, key }, app.fetch)


curl response:
# curl -v https://localhost
*   Trying 127.0.0.1:443...
* Connected to localhost (127.0.0.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* SSL connection timeout
* Closing connection 0
curl: (28) SSL connection timeout


Can it be caused by something unstable inside Deno.serve?

# deno -V
deno 1.39.1
Was this page helpful?