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:
curl response:
Can it be caused by something unstable inside Deno.serve?
1 Reply
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the code snippet you provided, I can offer some general advice, but please note that this advice is not based on the Deno documentation, and you should double-check the accuracy of the advice given.
In your
main.ts
script, you are using Deno.serve
to start an HTTPS server by providing a cert
and key
. The syntax for using Deno.serve
looks correct, and you are correctly awaiting the reading of the certificate and key files.
One thing to note is that you are using the Hono
framework, and you are passing app.fetch
to Deno.serve
. Make sure that app.fetch
is the correct method to handle the incoming requests for the Hono framework. If app.fetch
is not a method provided by Hono, this could potentially cause issues.
Additionally, since the issue occurs randomly after some time, it might not be directly related to the syntax or the way you are using Deno.serve
. It could be related to network issues, resource limitations, or other environmental factors that are not immediately apparent from the code snippet.
If the problem persists, you might want to look into the following:
- Check the server logs for any errors or warnings that might indicate what is causing the timeout.
- Monitor the server's resource usage to see if there's a memory leak or if the server is running out of resources.
- Ensure that the server's firewall or any other network configurations are not interfering with the SSL/TLS connections.
Remember to always refer to the official Deno documentation and the Hono framework documentation for the most accurate and up-to-date information.