Book Image

Node Cookbook: Second Edition

By : David Mark Clements
Book Image

Node Cookbook: Second Edition

By: David Mark Clements

Overview of this book

Table of Contents (18 chapters)
Node Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up an HTTPS web server


In large part, SSL is the solution to many of the security vulnerabilities, such as network sniffing and man-in-the-middle attacks, faced over HTTP. Thanks to the core https module. It's really simple to set up.

Getting ready

The greater challenge could be in actually obtaining the necessary SSL/TLS certificate. In order to acquire a certificate, we must generate an encrypted private key, and from that we generate Certificate Signing Request (CSR). This is then passed to Certificate Authority (CA). CA is a commercial entity specifically trusted by browser vendors—naturally this means we have to pay for it. Alternatively, the CA may generate your private key and CSR on your behalf.

After a verification process, the CA will issue a public certificate enabling us to encrypt our connections.

We can shortcut this process and authorize our own certificate (self-sign), naming ourselves the CA. Unfortunately, if the CA isn't known to a browser, it will warn the user that...