问题标签 [handshaking]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
315 浏览

ruby - HTML5 web sockets - how to communicate with them?

I've tested many socket examples and communication between them was pretty simple: socket is opened and stays open until you close it and no information is being sent except the one you have sent.

With HTML5 web sockets these two moments are different.

At first, as soon as the client HTML5 socket connects to server socket it sends a bunch of information:

How to interpret this information? What to do with it?

At second, when I send some string from debugging server (Hercules setup utility), socket's onmessage event is not fired and client socket closes the connection immediately after this.

So, I suppose that HTML5 web socket expects some handshaking before it could be used. Where to read about it?

BTW: I am using Ruby as server-side language.

0 投票
1 回答
1363 浏览

certificate - Handshaking with Octopus server fails from a TeamCity agent

We've been successfully using TeamCity and Octopus on a single machine, and now we have added a new build agent due to growing number of simultaneous builds. I have set up a new Octopus Tentacle and verified that Tentacle is reachable from the Octopus server in Listener role. However,any build that uses Octopack fails when executed on the new TeamCity agent. Here is an extract from the build log:

Running command: octo.exe create-release --server servername:8443 --apikey SECRET --project NRK Bridge (Legacy) --enableservicemessages --version 0.0.0.662 --deployto Dev --waitfordeployment --package=NRK.Bridge.Web:0.0.0.662 --packageversion=0.0.0.662 [12:06:02]Creating Octopus Deploy release [12:06:02]Octopus Deploy Command Line Tool, version 2.0.8.22 [12:06:03]Handshaking with Octopus server: servername:8443 [12:06:06]The following certificate errors were encountered when establishing the HTTPS connection to the server: RemoteCertificateChainErrors [12:06:06]Certificate subject name: CN=servername [12:06:06]Certificate thumbprint: 79C26(...) [12:06:07]The following certificate errors were encountered when establishing the HTTPS connection to the server: RemoteCertificateChainErrors [12:06:07]Certificate subject name: CN=servername [12:06:07]Certificate thumbprint: 79C26(...) [12:06:08]The following certificate errors were encountered when establishing the HTTPS connection to the server: RemoteCertificateChainErrors

What I noticed is that the certificate thumbprint in the build log is different from thumbprints shown in Octopus server machine page. I tried to generate a new API key and re-register a Tentacle. Am I overlooking something here?

0 投票
1 回答
44 浏览

ios - 摇晃后如何调用谷歌页面

摇晃iPhone后我尝试调用谷歌页面。我尝试过这样

两种方法有效,但是当我摇动 iPhone 时摇动图像不显示但谷歌页面打开所以请帮助我。我需要当我摇动手机时第一次摇动图像,摇动完成后摇动打开到谷歌页面。

先谢谢了。

0 投票
1 回答
2134 浏览

android - Android / Socket.io 客户端 - 如何在与服务器握手时发送 cookie?

我正在尝试(未成功)连接到 socket.io 服务器,但我不断收到相同的错误: io.socket.SocketIOException: Error while handshakingjava.net.ConnectException: failed to connect to my.domain.name.com (port 8080) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused).

我刚刚发现我应该在握手时发送一个带有以下值的 cookie:域、路径、名称和值。在尝试了几种可能的方法之后(基于thisthis),我最终得到了那段代码,但它仍然无法正常工作:

CookieManager.getInstance().getCookie(...)不断返回 null 并且连接仍然失败。

有人可以帮我在标题中添加一个cookie吗?

为了记录,我不知道它会改变什么,但我正在使用这个库:https ://github.com/Gottox/socket.io-java-client

在此先感谢您的帮助 !

马修

0 投票
2 回答
1994 浏览

android - 使用 android 作为服务器和浏览器作为客户端创建 websocket 握手

我希望能够在我的 android 设备上使用浏览器作为短信编辑器(类似于https://www.mysms.com)。所以我开始编写一个充当套接字服务器并使用浏览器作为客户端的 android 应用程序(例如http://www.websocket.org/echo.html)。我能够从该客户端访问我的应用程序并从中获取消息,但我现在遇到了 WebSocket 握手(Sec-WebSocket-Key 等)的问题。

编辑:

我按照本教程编写了我的 android 服务器:http ://android-er.blogspot.co.at/2014/02/android-sercerclient-example-server.html

当我试图从http://www.websocket.org/echo.html访问该服务器时,我收到了这个 js 错误:WebSocket 握手期间出错:状态行无效

编辑:

所以我为 Sec-WebSocket-Accept: 行添加了带有编码密钥的标头

并使用以下方法对结果进行编码:

并传递如下标题:

响应头现在看起来像这样:

但我仍然收到错误:失败:WebSocket 握手期间出错:“Sec-WebSocket-Accept”标头值不正确

0 投票
0 回答
249 浏览

openssl - 使用外部 REST 服务时出现 PeopleSoft IntegrationGateway 错误

我们将 PT8.53 与 weblogic 10.3.6 一起使用。当我们的进程尝试使用外部 REST 服务时,Integration Gateway 出错了

我们使用的是安装了 openssl 0.9.8j 的 SUSE 11 VM。第 3 方正在使用 TLS1.2。

从日志来看,双方似乎协商使用 SSLv3,但不知何故仍然出错。

我的疯狂猜测(我不擅长 SSL/TLS 部分)是 weblogic 使用的 openssl 与第 3 方的 SSL/TLS 不兼容,因此第 3 方断开了我们的连接。

我对大家的问题是: 1. Weblogic 如何使用(如果使用)openssl?里面有编译吗?或者它只是在尝试与第 3 方握手时调用一个库?2. 如果它正在调用一个库,我如何将它重定向到更新版本的openssl?(我们可以将最新的 openssl 安装到其他位置,而不是默认位置)。

我无法附上图片。但是我有一个 dumpcap 日志,我可以在那里看到加密的警报。

0 投票
0 回答
2522 浏览

node.js - Websocket握手,JWT理解安全

嗨,我正在尝试了解此握手的工作原理和 JWT。所以我有一些东西作为网页,一些用户可以去那里登录自己。然后我创建了一个 JWT,所以当我向服务器发出请求时,我使用这个令牌来验证用户。我想创建和 websoket 连接并使用这个令牌。所以我做了这样的服务器

在那个文件 websockets.js 我有

所以问题是,如果我登录浏览器并复制标题中的那个令牌。我可以使用 wscat 连接到具有不同终端的服务器。所以我试图了解握手是如何工作的,这可以帮助我预防这一点。

所以我的想法是让这个表格成为标题MTMtMTQ0Mjk1OTI3NjY1NA==

将它添加到客户端并在每个调用表单中客户端检查该值是否相同,但不确定这是否正确。我不能很好地理解它,所以如果有人可以解释这很好,或者如果我没有 ssl 连接,我可以用什么来防止这种劫持。

0 投票
1 回答
107 浏览

java - 当 App 后台摇晃方法不起作用时

我们正在尝试在android中实现摇动方法。如果我们关闭应用程序,它会使用服务在后台运行,在这种情况下,它会在后台运行,但不会使用传感器和加速度计达到摇动方法。任何人都可以提供该服务的示例代码. 请指导我们并告诉它是否可能

0 投票
1 回答
4430 浏览

node.js - 使用基于 TCP 的 SSL 使用 NodeJS 在两台服务器之间建立安全连接

我正在尝试将包从一台服务器发送到另一台服务器,但我需要确保发件人是“真正的”发件人并且无法拦截该包,我如何使用 SSL 和 NodeJS 或其他方式来做到这一点。

这就是我所做的:

服务器代码:

客户端代码:

这会出错:

0 投票
0 回答
1632 浏览

ios - Volley android“javax.net.ssl.SSLHandshakeException:握手失败”

嗨,我正在使用 volley 库重建 API 调用

这是我发送 XML 数据和接收 xml 响应的测试代码(我只需要成功接收字符串格式的响应)

我已经测试了字符串urlpayloadPOSTMAN 并给出了成功的结果。但不知道为什么我的 android 应用程序会出现此错误

请注意仅 API 23+(android 6.0 及更高版本)API 22 工作正常的问题!

我尝试设置重试策略但不起作用。任何人都知道代码有什么问题。提前致谢