The error is not caused by the code you have in your question.
What you are doing is that you are creating a new HTTP server, that will listen to httpsPort and will bind to 0.0.0.0 which means all local IP addresses.
I suggest you omit 0.0.0.0 when binding to all local IP addresses since this is the default behavior anyway, but this is not a problem.
Then you are assigning this server the certificate local-certificate.pem which means that clients connecting to this server will be presented this certificate.
You are not connecting to any external APIs in this part of the code.