- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 yaws 网络服务器。我正在尝试通过本地网络中的 https 进行连接。
当我在 yaws.conf 中为 http 设置服务器时,如下所示,当我通过 http://0.0.0.0:80/myappmod 连接时一切正常在浏览器中
<server *:80>
port = 80
listen = 0.0.0.0
docroot = /home/anyuser/anydir/
auth_log = true
appmods = </, myappmod>
</server>
但以下配置(使用 ssl)没有:(我通过
https://0.0.0.0:443/myappmod 连接)
<server mydomain.com>
port = 443
docroot = /home/anyuser/anydir/
listen = 0.0.0.0
dir_listings = true
auth_log = true
appmods = </, myappmod>
<ssl>
keyfile = /home/anyuser/private-key.pem
certfile = /home/anyuser/cert_by_ca.pem
depth = 0
</ssl>
</server>
该证书由证书颁发机构正式颁发,通常适用于“mydomain.com”下的其他网络服务器。
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7WBJR0YV9bq4P
...
CAy+LaJpyW/b2vQ+He7t/rg=
-----END PRIVATE KEY-----
.crt 文件是这种格式:
-----BEGIN CERTIFICATE-----
MIIGgjCCBWqgAwIBAgIIZiCEI/Q/x7gwDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV
...
1CtNn+5v4lBpgzWS0ZSv5xkeskHjzXnRbjl7jzbkwUdseCZHwXc=
-----END CERTIFICATE-----
当我尝试连接时,我得到
ERR_CONNECTION_RESET 在 Chrome 和
PR_END_OF_FILE_ERROR 在火狐中。
trace.log
来自
curl -v -k --trace-ascii trace.log https://0.0.0.0:443/
的输出:
== Info: Trying 0.0.0.0:443...
== Info: Connected to 0.0.0.0 (127.0.0.1) port 443 (#0)
== Info: ALPN, offering h2
== Info: ALPN, offering http/1.1
== Info: TLSv1.0 (OUT), TLS header, Certificate Status (22):
=> Send SSL data, 5 bytes (0x5)
0000: .....
== Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
=> Send SSL data, 512 bytes (0x200)
0000: .......w.`0V;k.z;7...}1..Y..5.;..WjO.. .4.,30.....L.......3.../.
0040: ..Y.....>.......,.0.........+./...$.(.k.#.'.g.....9.....3.....=.
0080: <.5./.....u..................................3t.........h2.http/
00c0: 1.1.........1.....*.(.........................................+.
0100: .......-.....3.&.$... ....d>..xlz#..H.V...|.R.s.k.t..r..........
0140: ................................................................
0180: ................................................................
01c0: ................................................................
== Info: OpenSSL SSL_connect: Die Verbindung wurde vom Kommunikationspartner zurückgesetzt in connection to 0.0.0.0:443
== Info: Closing connection 0
== Info: TLSv1.3 (OUT), TLS alert, decode error (562):
=> Send SSL data, 2 bytes (0x2)
0000: .2
EDIT2: Die Verbindung wurde vom Kommunikationspartner zurückgesetzt 意思是:
通讯伙伴 重置了连接用英语讲。
.pem
和一个
.crt
文件。他们的内容在我看来一模一样。内容如上所示。(我在 yaws.conf 中使用了 .pem 文件)。我使用的 key 文件是我从 godaddy.com 上的证书签名请求复制的输出。 (只需从他们的 Web-TextBox 复制它并将其粘贴到 ubuntu 上的 .txt 文件中)。
openssl s_client -connect mydomain.com:443
(dns 适用于 http//mydomain.de:80)给了我:
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 310 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
编辑4:
openssl s_server -accept 8443 -cert /etc/mydomain.pem -key /etc/mydomain.key -CAfile /etc/gd_bundle-g2-g1.crt
openssl s_client -connect localhost:8443 -cert /etc/mydomain.pem -key /etc/mydomain.key -CAfile /etc/gd_bundle-g2-g1.crt -verify 8 -verify_hostname mydomain.de
这导致成功的握手:
... Certificate and other data I do not want to post and:
SSL handshake has read 5658 bytes and written 373 bytes
Verification: OK
Verified peername: mydomain.de
... more data
然后我使用以下配置文件设置了一个 http 和一个 http 服务器。我进一步保证 .pem 和 .key 文件可以通过 chmod +777 的 yaws 访问(我知道这很糟糕,但我只是想确定一下)。然后我启动了 yaws 服务器(使用 root 权限,我知道这也是邪恶的,但是在我弄清楚如何以非 root 身份绑定(bind)到特权端口之前,我只是为了测试而使用它)
logdir = /var/log/yaws
ebin_dir = /usr/local/lib/yaws-appmods/ebin
include_dir = /usr/local/lib/yaws-appmods/include
max_connections = nolimit
keepalive_maxuses = nolimit
process_options = "[]"
acceptor_pool_size = 8
trace = false
use_old_ssl = false
copy_error_log = true
log_wrap_size = 0
log_resolve_hostname = false
fail_on_bind_err = true
pick_first_virthost_on_nomatch = false
keepalive_timeout = 30000
sni = enable
<server mydomain.de>
port = 80
listen = 192.168.178.75
docroot = /home/my_non_root_user/my_appmod/
auth_log = true
appmods = </, my_appmod>
</server>
<server mydomain.de>
port = 443
docroot = /home/my_non_root_user/my_appmod/
listen = 192.168.178.75
dir_listings = true
auth_log = true
appmods = </, my_appmod>
<ssl>
keyfile = /etc/mydomain.key
certfile = /etc/mydomain.pem
depth = 0
</ssl>
</server>
我还尝试提供 ca-bundle,设置更高的深度,并使用其他一些参数,但都没有成功。我得到了与上述相同的错误。在下面的 yaws 输出中,只能看到 http 正在工作。当我尝试通过 https 连接时,没有产生输出。没有 worker 等。总的来说,我对偏航和网络服务器很陌生。我非常喜欢 erlang,只想拥有一个自己的小型网络服务器。没有生产就绪的复杂解决方案。我想我在配置文件中做错了什么,或者对整个网络服务器概念的了解不完整。
1> =INFO REPORT==== 30-Jan-2022::21:16:55.826108 ===
Yaws: Using config file /etc/yaws/yaws.conf
=ERROR REPORT==== 30-Jan-2022::21:16:55.839289 ===
use_old_ssl in yaws.conf is no longer supported - ignoring
=INFO REPORT==== 30-Jan-2022::21:16:55.904479 ===
yaws debug:Add path "/usr/local/lib/yaws-appmods/ebin"
=INFO REPORT==== 30-Jan-2022::21:16:55.906202 ===
yaws debug:Add path "/usr/lib/yaws/examples/ebin"
=INFO REPORT==== 30-Jan-2022::21:16:55.906272 ===
yaws debug:Running with id="default"
Running with debug checks turned on (slower server)
Logging to directory "/var/log/yaws"
=INFO REPORT==== 30-Jan-2022::21:16:55.911016 ===
Ctlfile : /root/.yaws/yaws/default/CTL
=INFO REPORT==== 30-Jan-2022::21:16:55.911698 ===
sync call startup:start
ENSURE SSL: {ok,[]}
=INFO REPORT==== 30-Jan-2022::21:16:56.045817 ===
Trace directory "/var/log/yaws/trace_20220130_211656" created
=INFO REPORT==== 30-Jan-2022::21:16:56.055200 ===
Yaws: Listening to 192.168.178.75:443 for <1> virtual servers:
- https://mydomain.de under /home/my_non_root_user/my_appmod
=INFO REPORT==== 30-Jan-2022::21:16:56.055388 ===
Yaws: Listening to 192.168.178.75:80 for <1> virtual servers:
- http://mydomain.de under /home/my_non_root_user/my_appmod
Worker: <0.194.0>
[2022-01-30 21:17:15.987] ===== CLI -> SRV =====
New (nossl) connection from 80.*.*.*:57260 // * are manually hidden numbers for stackoverflow post
Worker: <0.200.0>
[2022-01-30 21:17:15.987] ===== CLI -> SRV =====
New (nossl) connection from 80.*.*.*:57262 // here too
Worker: <0.200.0>
[2022-01-30 21:17:15.994] ===== CLI -> SRV =====
GET / HTTP/1.1
Connection: keep-alive
Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/avif, image/webp, image/apng, */*;q=0.8, application/signed-exchange;v=b3;q=0.9
Host: mydomain.de
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Cookie: pvisitor=cc2529f0-abf8-4e78-80d2-85908b25f227
Accept-Language: en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1
Worker: <0.200.0>
[2022-01-30 21:17:15.996] ===== SRV -> CLI =====
HTTP/1.1 200 OK
Server: Yaws 2.1.0
Date: Sun, 30 Jan 2022 20:17:15 GMT
Content-Length: 46
Content-Type: text/html
Worker: <0.200.0>
[2022-01-30 21:17:16.203] ===== CLI -> SRV =====
Connection: keep-alive
Accept: image/avif, image/webp, image/apng, image/svg+xml, image/*, */*;q=0.8
Host: mydomain.de
Referer: http://mydomain.de/
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Cookie: pvisitor=cc2529f0-abf8-4e78-80d2-85908b25f227
Accept-Language: en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7
Accept-Encoding: gzip, deflate
Worker: <0.200.0>
[2022-01-30 21:17:16.203] ===== SRV -> CLI =====
HTTP/1.1 405 Method Not Allowed
Server: Yaws 2.1.0
Date: Sun, 30 Jan 2022 20:17:16 GMT
Content-Length: 0
Content-Type: text/html
最佳答案
在您的 yaws.conf
文件,您的 keyfile
<ssl>
中的参数 block 是指带有 .key
的文件后缀。根据Erlang ssl module man page ,该文件应改为 PEM 格式(即 .pem
文件)。
ssl
手册页说如果你遗漏了 keyfile
参数,默认与certfile
相同,因此您可以尝试删除 keyfile
来自您的yaws.conf
文件看看是否有帮助。 .key
文件到 .pem
文件; this answer描述如何做到这一点。 关于ssl - Yaws 网络服务器通过 HTTP 运行,但不通过 HTTPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70888337/
发起 HTTPS 对话时,会生成一个随机数来为交换创建 key (或类似的东西)。我不明白这是如何防止重放攻击的。 为什么攻击者不能重复真实客户端发出的所有请求? This answer claims
要使这个简单的 HTTP header 与支持 HTTPS 的服务器通信,还需要进行哪些其他更改。 GET /index.php HTTP/1.1 Host: localhost [CR] [CR]
我想弄清楚 HTTPS 是有状态还是无状态?这是关于我构建的 RESTful API。我们最初使用 HTTP。由于 HTTP 本质上是在无状态的 TCP/IP 上工作的,因此 HTTP 是无状态的,但
我从各种来源了解到,HTTPS 握手是使用 HTTPS 中最重要的部分。我在服务器之间内部使用 POST 来传达信息,并希望为此使用 HTTPS。我想知道实际的 HTTPS 握手持续多长时间/“保持打
我想知道HTTPS是如何实现的。是数据加密还是路径加密(数据通过哪个路径)。如果有人向我提供实现细节,我将不胜感激。 最佳答案 很简单,HTTPS 使用安全套接字层来加密客户端和服务器之间传输的数据。
我是 HTTPS 技术的初学者:(。我对 HTTPS 的实现有一些疑问。 假设我有一张注册表 http://www.sitename.com/register.php 如果我想在 HTTPS 中使用它
在带有 Devise 1.51 的 Rails 3.1.1 应用程序中,我希望确认消息中使用的确认链接是 https 而不是 http。因此,在电子邮件中,“确认链接”会指向如下内容: https:/
我对 HTTPS 有疑问。我的一位前辈告诉我,Https 实际上并不使用 SSL/TLS,而只是使用它们的加密算法。他说,证书的握手过程是在传输层完成的,但实际有效负载的安全 key 加密是在应用层完
我建立了一个使用 PHP mail() 的网站。如果我在 http://上点击脚本,我可以让它成功运行,但如果我切换到 https://它就不起作用了!我使用 Godaddy 进行托管,并通过他们购买
我最近更改了域并设置了来自 https://sadlergatestoyou.co.uk 的重定向至https://www.sadlergates.co.uk但是,www.sadlergatestoy
我正在制作一个依赖于设置 http.proxyPort 和 http.proxyHost 的 Java 应用程序。有两个进程:一个是正则程序,一个是代理程序。我有一个在 http.proxyPort(
我正在开发一个 RESTful 应用程序,为此我需要将从 http 地址传入的请求重定向到它的 https 等效项。我似乎无法使用 ring/compojure 启用 https。 有人有一些有用的教
我看过很多关于重写的文章。都好。但没有一个涵盖这种具体情况。所以这是我的问题:希望你能帮忙。因为我无法让它发挥作用。 我们在domain.com(非www)上运行网站 我们已设置 ssl(因此仅限 h
我需要将大量请求自动提交到基于云的数据库接口(interface) (Intelex)。没有任何方法可以批量提交某些操作,但是提交单个请求所必需的只是让经过身份验证的用户尝试打开 Web 链接。因此,
我正在使用 https 设置一个独立的(非嵌入式) jetty 9.2.1。 我在本地机器上使用自签名证书玩了一会儿,一切顺利。 现在我正在设置一个 uat 服务器(类似于我将在生产中获得的服务器),
我对 Web 开发(从今年 1 月开始)和 Web 安全(在不到一周前开始!)都是新手,所以如果我的问题完全没有受过教育、误导或简单愚蠢,请原谅我。 我工作的公司的主要产品是一个很好的老式客户端/服务
HTTPS头是否加密到什么程度(如果有的话)? 最佳答案 它们在通过SSL传输时被加密。没有专门用于 header 的特殊加密,HTTPS对整个消息进行加密。 关于https - HTTPS head
在 HTTPS 安全模型中,最薄弱的部分是浏览器中的可信 CA 列表。有人可以通过多种方式将额外的 CA 添加到用户信任错误的人的列表中。 例如,您公司的公用计算机或 PC。管理员可能会强制您信任自己
我们最近切换到 HTTPS,当提交我们的一个表单时,Firefox 会弹出: Although this page is encrypted, the information you have ent
我知道没有愚蠢的问题,但这是:您能否在完全支持 https 的网站上通过 AdSense 或其他方式转换基于上下文的广告? 最佳答案 更新: We’ve updated the AdSense ad
我是一名优秀的程序员,十分优秀!