diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index 95079f4128..e881cca2a3 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -627,6 +627,17 @@ function serve(arg1, arg2) { reusePort: options.reusePort ?? false, }; + if (options.certFile || options.keyFile) { + throw new TypeError( + "Unsupported 'certFile' / 'keyFile' options provided: use 'cert' / 'key' instead.", + ); + } + if (options.alpnProtocols) { + throw new TypeError( + "Unsupported 'alpnProtocols' option provided. 'h2' and 'http/1.1' are automatically supported.", + ); + } + let listener; if (wantsHttps) { if (!options.cert || !options.key) {