- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用新的套接字 API (Chrome.sockets.tcp) 开发 Chrome 应用程序。我已经能够成功地让所有 HTTP 请求正常工作,没有任何问题。我遇到的问题是使用 TLS 握手的 HTTPS 登录。我们创建了一个 Visual Studio C# (RestRequest) 应用程序。我们可以使用 HTTPS 进行连接。使用 Wireshark,我注意到成功的通信是使用 TLSv1 实现的。
我尝试了多种解决方案,并引用/试验了以下链接,并试图提出一个解决方案。
还有更多链接!我写了一堆测试应用程序,但在最初的握手后都进入了死胡同。
下面的代码序列似乎完成了握手,但我无法发送登录信息。好像握手后套接字搞砸了。 (WireShark 显示所有 com 在登录后都是成功的)。
var that = this;
chrome.sockets.tcp.create({
persistent: false,
name: "hc",
bufferSize: 8192
}, function (createInfo) {
console.log("create info = " + JSON.stringify(createInfo));
if (chrome.runtime.lastError) {
error('Unable to create socket: ' + chrome.runtime.lastError.message);
}
that._socketId = createInfo.socketId;
chrome.sockets.tcp.setPaused(that._socketId, true, function () {
chrome.sockets.tcp.connect(that._socketId, that._httpHost, that._httpPort, function (result) {
chrome.sockets.tcp.onReceive.addListener(that._onReceive.bind(this));
chrome.sockets.tcp.onReceiveError.addListener(that._onReceiveError.bind(this));
chrome.sockets.tcp.secure(that._socketId, function (secureResult) {
chrome.sockets.tcp.send(that._socketId, str2ab('POST / HTTP/1.1\r\nHOST: ' + that._httpHost + '\r\n\r\n'), function (sendResult) {});
});
});
});
});
我已经尝试从 nmp forge 实现 TLSSocket,我得到了与上面示例相同的结果。
我们必须为此应用程序使用 TCP,主要是为了在 Chrome 应用程序中支持 cookie。
有没有人有解决方案或建议?我们已经投入了大量时间进行反复试验,但似乎已经走到了死胡同。
最佳答案
您需要在套接字安全后取消暂停。例如chrome.sockets.tcp.setPaused(that._socketId, false, ...)
关于javascript - chrome.sockets.tcp.secure 和 TLS 握手未按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42588358/
当我测试我的网站性能时,我注意到 SSL 握手是连接设置的一部分。我了解(页面的)第一个请求需要完整的 SSL 握手。 但是,如果您从 pingdom 测试中注意到,只有某些其他资源在进行 SSL 握
在 SSL 握手期间,浏览器会根据需要使用提供的 URL 从主机 Web 服务器下载任何中间证书。我相信浏览器附带来自公共(public) CA 的预安装证书,这些证书只有根证书的公钥。 1) 当使用
在配置了客户端身份验证的 TLS 握手中,有一个步骤,服务器接收客户端的证书并选择是否信任它(例如,在 Java 中,它是通过 TrustManager 完成的)。 我想知道来自服务器的最终“信任失败
我正在尝试了解 Android 与服务器的 TLS 连接。有人可以纠正我吗? 有两种启动 TLS 连接的方式。首先,只有服务器有证书,客户端决定是否信任它。其次,客户端和服务器都获得了证书。我说得对吗
我正在创建一个社交网站,我希望用户在其中聊天并接收实时通知,例如 Facebook,我尝试搜索可能的解决方案并找到了 ejabberd 的 pubsub 模块(我正在使用 ejabberd 进行聊天)
我正在编写一个应用程序来(非正式地)替换在 adobe air 中制作的客户端,他们使用 RTMP 作为连接协议(protocol),我必须创建自己的类来实现它:< 据我所知,RTMP 属于 TCP
我正在做一个关于 TLS 握手的学术项目,我已经捕获了由多个客户端(谷歌浏览器、Firefox ......)生成的一些 TLS 流量,我想看看对于给定的浏览器,客户端 hello 消息是否总是相同的
我使用 openssl 实现了一个 DTLS 服务器。 (我有一个 udp 套接字,我正在使用内存 bio 与 openssl 通信。)但是,如果丢包,DTLS 握手可能需要 1-2 秒,这在我的情况
我编写了一个 PHP 程序来执行包含 openssl 命令的批处理文件: openssl s_client -showcerts -connect google.com:443 >test.cert
我编写了一个 PHP 程序来执行包含 openssl 命令的批处理文件: openssl s_client -showcerts -connect google.com:443 >test.cert
客户: var socket = new WebSocket('ws://localhost:8183/websession'); socket.onopen =
当有这么多证书时,浏览器如何知道在 ssl 握手中的客户端身份验证步骤中将哪个证书发送到服务器。我的意思是它如何识别哪个证书适用于哪个服务器 最佳答案 现在是 CyberMonk 的问题 如果您在
我正在尝试使用 python 连接到 XMPP 服务器。我有要连接的 XML,只是不确定如何进行连接的 TLS 部分?我可以找到很多 HTTPS TLS 示例和 XMPP 示例,只是不知道如何将两者放
我需要在我的 Python 服务器中实现 Websocket 握手。我的 python 服务器正在使用 Twisted 进行事件处理。我找到了 this webpage这解释了这个过程,但是当涉及到这
是否可以在当前 SSL 连接保持事件状态时重新协商 SSL 握手。当新的握手成功时,服务器应响应新握手的确认。 我搜索过 SSL 重新协商,但找不到任何具体内容。有谁知道这样的事情是否可能? 最佳答案
我编写了一个客户端-服务器应用程序,旨在通过局域网交换文件(以及其他内容)。在服务器模式下,应用程序监听具有特定标识 header 的 TCP 连接。在客户端模式下,它会尝试与用户提供的 IP 地址建
我有两台服务器通过 SSL 进行通信。 server1 通过 SSL 启动到 server2 的 SSL 连接。服务器 1 有一个 key 大小为 1k 的 keystore ,而服务器 2 有一个
架构是中间层 Liberty 服务器,它接收 http 请求和代理到各种后端,一些是 REST,一些只是 JSON。当我为 SSL 配置时(仅通过非常酷的 envVars)......似乎我得到了每个
我需要一些关于 TLS 的解释:每次客户端想要将自己连接到服务器时是否都执行 TLS 握手?每次都重新创建 session key ? premasterkey 和 masterkey 也是吗?Cli
我正在尝试将 TimeoutMixin 合并到基于 SSL 的协议(protocol)中。但是,当超时发生并且它调用 transport.loseConnection() 时,什么也没有发生。我认为这
我是一名优秀的程序员,十分优秀!