-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@hono/vite-dev-server] Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:httpbin.org, DNS:*.httpbin.org #99
Comments
Hi @Code-Hex Which version of |
I'm using 0.8.0. I am also investigating. I'm sorry, I made a mistake in the order of describing the issues in the ticket. Actually, the error occurs due to the following problem. The error in the title of this issue occurs when the following code is commented out. vite-plugins/packages/dev-server/src/dev-server.ts Lines 158 to 163 in 81d8e18
There are two issues. The one I initially wrote and the I also suspect that the if (!(response instanceof Response)) {
console.log(new Response(null, 200), response)
throw response;
} and below is the output it generates.
I think this is similar issue: nodejs/undici#2358 I confirmed this code works fine! (but there seems to be a better way 😇 ) if (!isResponse(response)) {
throw response;
}
function isResponse(v: any): v is Response {
return ["Response", "_Response"].includes(response.constructor.name)
} |
Hi @Code-Hex Thanks for investigating!
I think it's not bad. But I'll find other good ways. |
Hi @Code-Hex Does this issue still happen? I've tried it with the latest |
@yusukebe Thanks for your confirmation! |
related: #24
Reproduce code:
Started-up vite server as 8787 and executed
npx local-ssl-proxy --key localhost-key.pem --cert localhost.pem --source 8788 --target 8787
, Request tohttps://localhost:8788/httpbin/get
via browser. I usedmkcert
to make localhost certification.It works on Cloudflare Workers and
wrangler dev
, but when passing through vite-dev-server, it produces the following error and stops working.Workaround
By rewriting the header's host as follows, it starts working. It seems there is a difference in the behavior of fetch between vite-dev-server and
wrangler dev
.The text was updated successfully, but these errors were encountered: