Skip to Content
Node与Express开发(第2版)
book

Node与Express开发(第2版)

by Ethan Brown
June 2021
Intermediate to advanced
290 pages
9h 21m
Chinese
Posts & Telecom Press
Content preview from Node与Express开发(第2版)
196
|
第
18
章
这个命令会向你询问各种细节,比如国家(地区)代码、城市、州、全限定域名(
FQDN
,
也叫
通用名
或
全限定主机名
)和邮件地址。既然这个证书是用于开发
/
测试的目的
,提供
的值就不是特别重要了(事实上,这些值都是可选的,但是如果都不填,得到的这个证书
在浏览器看来就更可疑了)。证书的
FQDN
是浏览器用来识别域名的
。因此,如果你在使
用
localhost
,
FQDN
就可以
使用它,你也可以使用服务器的
IP
地址,或者服务器名(要是
有的话)。如果证书的通用名跟在
URL
中使用的域名不匹配
,那么加密仍然会正常工作,
但对于这个不匹配,浏览器会发出额外的警告信息。
如果你对这个命令的细节感到好奇,可以从
OpenSSL
的官方文档页上详细了解。值得指出
的是,
-nodes
选项跟
Node
没有任何关系,实际上只表示“
no DES
”,意味着私钥并非是
DES
加密的。
这个命令的结果是得到了
meadowlark.pem
和
meadowlark.crt
这两个文件
。其中“隐私增强
邮件”(
PEM
)文件就是私钥
,不该被客户端访问到。而
CRT
文件是自签名的证书,它将
被发送到浏览器,用以建立安全连接。
除了自己运行命令,有些网站也会提供免费的自签名证书,读者可自行查找。
18.1.2
 使用免费的证书中心
HTTPS
以信任为基础,但一个不幸的事实是,如果要在互联网上获取信任,最容易的办法
就是花钱购买。不过,这也并非是糊弄人的办法:毕竟建立起安全基础设施、为证书做担
保,以及维护跟浏览器提供商的关系的工作都成本高昂。
对于生产级的证书来说,购买证书并非是唯一合法选择:作为一个基于开源的免费自动化 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

面向对象的思考过程(原书第5版)

面向对象的思考过程(原书第5版)

马特 魏斯费尔德
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115565099