切换到 SSL 时 JMeter 停止发送 JSESSIONID cookie
我有一个在 http 下运行良好的测试计划,并且 Cookie 管理器正确地将我的会话保持在适当的位置。当切换到 ssl 时,它还能够与同一台服务器进行通信,甚至认为一切正常,因为它会收到 200 响应,其中包含我们关于未登录的自定义消息。
要重现该行为,我所需要做的就是从http 到 https。测试仍然能够与服务器通信,但我可以在“查看表中的结果”日志中看到cookie在http下有一个JSESSIONID,在https下为空。 ssl 下的每个请求都会通过 JSESSIONID 的 Set-Cookie 进行应答。
I have a test plan that runs fine under http, and the Cookie Manager is correctly keeping my sessions in place. It is also capable of talking to the same server when switched to ssl, and even thinks everything is working correctly because it gets a 200 response with our custom message about not being logged in.
All I need to do to reproduce the behavior is switch from http to https. The test is still able to talk to the server, but I can see in the "View Results in Table" log that cookies has a JSESSIONID under http, and is empty under https. And each request under ssl is answered with a Set-Cookie for JSESSIONID.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有趣的场景。 Jmeter 日志文件是否提供任何线索?
难道 Jmeter 需要证书的副本才能正确存储 SSL cookie?控制台会显示握手问题,可以通过将证书添加到密钥库中来解决:
http://www.java-samples.com/showtutorial.php?tutorialid=210
您可以通过将 cookie 值写入变量并记录其值来进行进一步的调试:
来源:http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager
编辑:有人问我的具体问题是如何解决的。事实证明,这与 ssl 没有任何关系,但其他不相关的标头的格式变化很小,因此我们用来匹配它们的正则表达式开始失败。因此,我首先查看您的标头并比较您发布 http 与 https 时的差异
Interesting scenario. Does the Jmeter log file offer any clues?
Could it be that Jmeter needs a copy of the certificate to properly store the SSL cookie? The console would display a handshake problem, which can be resolved by adding the certificate into the key store:
http://www.java-samples.com/showtutorial.php?tutorialid=210
You might be able to do some further debug by writing out the cookie value to a variable and logging its value:
Source: http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager
Edit: Somebody asked how my specific problem was solved. It turned out not to have anything to do with ssl specifically, but that other unrelated headers changed very slightly in their format, so the regex we were using to match on them started failing. So I'd start there with looking at your headers and comparing the difference between when you post http vs https