You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating an https server with node:https reports that options key and cert are invalid, despite stating in the official node https documentation to include key and cert.
Bun does actually create the https server with the certificate details perfectly fine, however it appears that the https module typings actually points to the http module typings.
import{createServerascreateHTTPS_Server}from"node:https";import{readFileSync}from"node:fs";import{createServerascreateHTTP_Server}from"node:http";createHTTP_Server({keepAlive: true},(req,res)=>{res.writeHead(200);res.end('hello HTTP\n');}).listen(8001,()=>console.log('HTTP listening on 8001'));createHTTPS_Server({keepAlive: true,// Totally fine!key: readFileSync('./keys/ssl-cert-snakeoil.key'),// <-- red underlinecert: readFileSync('./keys/ssl-cert-snakeoil.pem'),// <-- red underline},(req,res)=>{res.writeHead(200);res.end('hello HTTPS\n');}).listen(8000,()=>console.log('HTTPS listening on 8000'));
What is the expected behavior?
Correct typings lol
What do you see instead?
TSC yelling at me that key and cert are not valid.
Additional information
The reason I am not using Bun.serve() with the TLS options is that when I get a new request, I cannot then check the client's certificate. I am creating an application that relies on this functionality, and Bun does not implement this in the native Bun.serve() api (from what I've seen).
The text was updated successfully, but these errors were encountered:
This is weird! If you import from https (without the node prefix) you don't get the ts error.
BUT it doesnt work with request from https! Bun completely ignores that i set the cert and key properties and this results in a 401. It does work with node.
What version of Bun is running?
1.0.11+f7f6233ea
What platform is your computer?
Darwin 23.2.0 arm64 arm
What steps can reproduce the bug?
Creating an https server with
node:https
reports that optionskey
andcert
are invalid, despite stating in the official node https documentation to includekey
andcert
.Bun does actually create the https server with the certificate details perfectly fine, however it appears that the https module typings actually points to the http module typings.
What is the expected behavior?
Correct typings lol
What do you see instead?
TSC yelling at me that
key
andcert
are not valid.Additional information
The reason I am not using
Bun.serve()
with the TLS options is that when I get a new request, I cannot then check the client's certificate. I am creating an application that relies on this functionality, and Bun does not implement this in the nativeBun.serve()
api (from what I've seen).The text was updated successfully, but these errors were encountered: