JMeter:HTTP 标头管理器和授权字段 (MD5-sess)
我正在使用 JMeter 2.4,我想测试一个使用 MD5-sess 算法的站点。由于 JMeter 只能处理基本身份验证,并且编写 JMeter 插件似乎很困难(教程对此如此说明),我编写了一个小 servlet 来生成 cnonce
、response
和 nc
字段对我来说。我将此 Servlet 称为带有摘要的普通请求,并提取这三个变量。
到目前为止没有问题。
然后我尝试创建一个 HTTP 采样器来调用实际的目标服务,并分配一个 HTTP 标头管理器作为子项。我在那里定义了标头字段“Authorization”来保存授权字符串。我对此进行了测试,发现标头字段没有出现在请求中。经过一番谷歌搜索后,我了解到 授权字段被忽略,因为HTTP 授权管理器处理此问题。但是,JMeter 不知道 MD5-sess。
如果我使用除“授权”之外的任何标头名称,标头字段将正确显示。
因此,我的问题是:我现在该怎么办?如何强制 JMeter 让我设置授权标头?
I'm using JMeter 2.4 and I want to test a site that uses the MD5-sess algorithm. As JMeter can only handle basic authentication and writing a JMeter plug-in seems to be difficult (the tutorial to this states so) I wrote a small servlet that generates the cnonce
, response
and nc
fields for me. I call this servlet like a normal request with the digest and extract those three variables.
So far no problem.
Then I tried to create a HTTP sampler to call the actual target service and assigned a HTTP Header Manager as a child. There I defined the header field "Authorization" to hold the authorization string. I tested this and noticed that the header field didn't appear in the request. After some googling I learned that the authorization field is ignored since the HTTP Authorization Manager handles this. However, JMeter doesn't know of MD5-sess.
If I use any header name other than "Authorization" the header field appears properly.
Therefore, my question is: What do I do now? How do I force JMeter to let me set the authorization header?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们通过使用计划 C(或者是计划 D?)解决了这个问题。由于 Jmeter 是开源的,我们看一下 HTTPSampler 并在那里应用了 MD5 内容。
We solved this by using plan C (or was it D?). Since Jmeter is open source, we took a look at HTTPSampler and applied the MD5-stuff there.