- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在 CentOS 7 上运行 Apache v2.4、PHP v5.6 w/php-fpm
所以我正在尝试让 wss 与 stunnel & Ratchet 一起工作。我有 Ratchet 的 Hello World ( http://socketo.me/docs/hello-world ) 在非 SSL 端口 8080 上使用测试代码成功运行。我可以从同一台机器远程登录,也可以从另一台机器远程登录。
通过阅读,我知道 ratchet 不支持 ssl 连接,但是通过用 stunnel 包装通信来支持,所以我设置了 stunnel 并在端口 8443 上监听了一个适当的证书,这似乎在工作(如日志所示)文件)。
当我尝试使用 Firefox 暂存器中的 wss 建立连接时,出现以下错误:Firefox 无法与位于 wss://testserver.testdomain.com:8443 的服务器建立连接
我可以通过各种日志文件看到正在创建的连接,但是由于我无法创建可靠的 wss 连接,所以某处通信失败。关于我遗漏了什么或我在哪里搞砸的任何想法?日志/代码如下
便签本代码
var conn = new WebSocket('wss://testserver.testdomain.com:8443');
conn.onopen = function(e) {
console.log("Connection established!");
};
conn.onmessage = function(e) {
console.log(e.data);
};
channel 配置:
cert = /etc/httpd/ssl/ov_wildcard.pem
[hublistener]
accept = 8443
connect = 8080
Stunnel 日志:
2016.05.11 14:43:28 LOG5[38759:140614807435328]: stunnel 4.56 on x86_64-redhat-linux-gnu platform
2016.05.11 14:43:28 LOG5[38759:140614807435328]: Compiled/running with OpenSSL 1.0.1e-fips 11 Feb 2013
2016.05.11 14:43:28 LOG5[38759:140614807435328]: Threading:PTHREAD Sockets:POLL,IPv6 SSL:ENGINE,OCSP,FIPS Auth:LIBWRAP
2016.05.11 14:43:28 LOG5[38759:140614807435328]: Reading configuration from file /etc/stunnel/stunnel.conf
2016.05.11 14:43:28 LOG5[38759:140614807435328]: FIPS mode is enabled
2016.05.11 14:43:28 LOG4[38759:140614807435328]: Insecure file permissions on /etc/httpd/ssl/cert.pem
2016.05.11 14:43:28 LOG5[38759:140614807435328]: Configuration successful
2016.05.11 14:45:59 LOG5[38765:140614807430912]: Service [hublistener] accepted connection from ***.***.***.***:39124
2016.05.11 14:45:59 LOG5[38765:140614807430912]: connect_blocking: connected 127.0.0.1:8080
2016.05.11 14:45:59 LOG5[38765:140614807430912]: Service [hublistener] connected remote server from 127.0.0.1:59795
Ratchet 示例输出:
[zxurian@ariel dev-hub]$ php module/HubListener/websocket.php
New Connection! (307)
New Connection! (317)
Connection 317 sending message "second window line 1
" to 1 other connection
Connection 317 sending message "second window line 2
" to 1 other connection
New Connection! (318)
Connection 318 sending message "GET / HTTP/1.1
Host: testserver.testdomain.com:8443
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 FirePHP/0.7.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Sec-WebSocket-Version: 13
Origin: https://testserver.testdomain.com
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: PrWlBjR2q6a0syT4oplnAQ==
Cookie: PHPSESSID=ci7102qouvqprhdpk483hv6ar3; exclusive_offers_popup=1; __utma=213556497.27501638.1462814210.1462827970.1462831402.3; __utmc=213556497; __utmz=213556497.1462814210.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=213556497.|1=l=%2F=1
x-insight: activate
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
" to 2 other connections
Telnet 连接 1
[zxurian@ariel ~]$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
second window line 1
second window line 2
GET / HTTP/1.1
Host: testserver.testdomain.com:8443
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 FirePHP/0.7.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Sec-WebSocket-Version: 13
Origin: https://testserver.testdomain.com
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: PrWlBjR2q6a0syT4oplnAQ==
Cookie: PHPSESSID=ci7102qouvqprhdpk483hv6ar3; exclusive_offers_popup=1; __utma=213556497.27501638.1462814210.1462827970.1462831402.3; __utmc=213556497; __utmz=213556497.1462814210.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=213556497.|1=l=%2F=1
x-insight: activate
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
最佳答案
我有一个在我自己的机器上运行的 Ratchet WebSocket,我也在使用 Apache2.4为了让它在 SSL 上工作,我做了:
代理传递套接字
在 (/etc/apache2/)apache2.conf 我添加了
//added for the websocket over SSL
ProxyPass /wss/ ws://alpha.example.com:8080/
这将我在端口 8080 上运行的 websocket 传递给 wss://alpha.example.com/wss/
为了确保您的 stunnel 配置正确,这就是我所做的在 (/etc/stunnel/)stunnel.conf
中cert = /etc/letsencrypt/live/www.example.com/cert.pem
key = /etc/letsencrypt/live/www.example.com/privkey.pem
[wss]
accept = 8082
connect = 8080
提醒:将我使用的 key 路径更改为您的 key 正在使用的路径。
在启动我的服务器的 PHP 文件中,我在 Ratchet 示例中使用了端口 8080
$webSock->listen(8080, '0.0.0.0'); // Binding to 0.0.0.0 means remotes can connect
关于ssl - 让 wss 使用 stunnel & ratchet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37171844/
我希望开始在服务器上使用 javascript,最有可能使用 node.js,以及使用 websockets 与客户端通信。但是,似乎没有很多关于使用 TLS 和 wss://处理程序的加密 webs
最近几天一直在为这个错误而苦苦挣扎 Authentication of type {http://service.soap.xcompany.com}AuthenticationHeader had
我正在使用 jax-ws 从 JAVA 调用使用 WS-Security 的 SOAP 服务。问题是响应包含一些 MustUnderstand header ,并且我收到 Element notund
我正在使用 .net 中开发的 Web 服务,该服务接受用户名和密码作为 SOAP header 的一部分。我创建了 SOAPHandler 来创建 header 。 我打印了如下消息: x
Web 服务托管在没有 Internet 连接的服务器上 我正在使用 SOAPUI 访问 Web 服务 url 并进行测试 但得到以下错误信息任何帮助真的很感激
我浏览了以下链接:SOAPFaultException "MustUnderstand headers (oasis-200401-wss-wssecurity-secext-1.0.xsd) are
可以使用CF10的人确认CF10是否支持安全的websocket wss://吗? http://blog.kaazing.com/2012/02/28/html5-websocket-securit
我有一个使用安全 websocket 的应用程序,但我遇到了麻烦。 我想使用wireshark 来调试问题,但是我无法找出正确的参数来放入wireshark 来监控和显示使用HTTPS 的安全Web
我有一个 Node 服务器 (Meteor.js),它应该使用 websockets 与另一台服务器进行通信。由于通信是在不涉及直接用户的服务器之间进行的,因此我选择使用自签名证书。 在哪里添加来自
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 已关闭 8 年前。 Improve
在为 SharePoint 开发复杂功能时,推荐的数据存储方法是什么?您应该将自己限制在 SP 列表以及随之而来的所有限制中,还是使用您自己的数据库,或者在 SP 数据库中创建表? 最佳答案 这实际上
首先,一点背景知识:我们有一个基于 WSS 3.0 的 Intranet 站点,该站点托管在 的服务器上。 DOMAIN_A.LOCAL 并设置为使用集成 Windows 身份验证根据 的 Activ
可以通过 IP 和 DNS 访问 Web 服务。 使用以下命令创建包含 DNS 作为通用名称以及 DNS 和 IP 作为 subjectAlternativeName 的自签名证书 openssl r
我在使用 HTTPS => WS 通信时遇到问题,但找不到解决方法。 我正在使用 Symfony 4.1 和 Ratchet WsServer。服务器通过 9090 端口上的 Symfony 命令启动
有没有办法查看Websocket流量? 只有 Websocket header 在初始握手时可见。 响应后一切都消失了: Connection Upgrade Sec-WebSocket-Accep
SharePoint 的搜索框存在问题。每当我们尝试搜索某些内容时,我们都会得到: Unable to validate data. at System.Web.Configuration.Machi
我是java新手。我想像这样连接到网络套接字: import java.net.URI; import java.net.URISyntaxException; public class PrimeB
我将网站移至 https://。在 http 到套接字上有一个通过 ws://sitename.com: 3003 的连接,现在它们必须在 wss://sitename.com: 3003 上可用。我
我正在尝试使用 nginx 反向代理将 websocket 连接 ws://升级到 wss://https://github.com/nicokaiser/nginx-websocket-proxy/
我发现有些移动网络提供商本身并不支持端口 80,但他们确实支持端口 443,我觉得这有点奇怪。无论如何,我无能为力,导致我从端口 80 切换到端口 433,使用 wss:// 代替 ws://。 我想
我是一名优秀的程序员,十分优秀!