gpt4 book ai didi

openssl - 使用 openssl 为 localhost 创建 csr

转载 作者:行者123 更新时间:2023-12-02 11:19:33 26 4
gpt4 key购买 nike

我正在使用 openssl(在 Windows 上)创建一个 CSR 来配合(测试试用)证书。我以前从来没有这样做过,我有一个问题:创建私钥后,您将创建一个 csr 文件,并要求您提供个人信息。它询问您的问题之一是通用名称,即域名。我目前只在本地主机上运行。我正在练习如何创建 https://网站。

问题:我可以通过执行 localhost:82 之类的操作来创建有效的 csr 吗?如果没有,我该怎么办?

最佳答案

简单的答案:打开您的hosts 文件(C:\Windows\System32\drivers\etc\hosts)并提供一个奇特的域名:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# ::1 localhost
127.0.0.1 localhost

127.0.0.1 example.com # <<< Your fancy domain goes here !!!

然后,告诉您的网络服务器向 example.com 提供 HTTPS 请求。

关于openssl - 使用 openssl 为 localhost 创建 csr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14309252/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com