简体   繁体   中英

Node.js on Azure Worker Role w/ SSL results in ERR_SSL_PROTOCOL_ERROR

I have a WorkerRole configured to start node.exe via the Runtime/EntryPoint/ProgramEntryPoint element in the csdef and have a HttpsIn EndPoint configured for https on port 443 w/ a valid certificate. I'm also setting the PORT environment variable in Runtime/Environment which is used by node to listen on for incoming requests.

When I start the service (either in local dev fabric or in Azure) and try to hit the service I get the following error:

SSL connection error
Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.

I have verified that node.exe is indeed started when the service starts, and if I look up the local port in the Compute Emulator, usually something like:

http://localhost:444

I am able to successfully hit node directly with that using my browser. I am also able to hit node through Azure when SSL is not configured.

What am I missing? Thanks!

The issue was that I was using the http module instead of the https module when starting the web server in Node. Works once I started the https server using the ssl certificate.

I was following a guide for SSL w/ Node in a WebRole, which requires a different set up than SSL w/ Node in WorkerRole.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM