xmpp tls 响应格式

发布于 2024-10-06 10:55:34 字数 374 浏览 3 评论 0原文

在收到质询后,我似乎无法找到 TLS 响应中应包含什么格式。我在哪里可以找到该信息?

假设我是用 PHP 做的,它应该是这样的:

$nonce = "somenoncevaluehere";
$qop = "auth";
$charset = "utf-8";
$algorithm = "md5-sess";
$server = "example.com";
$user = "bob";
$pass = "somepass";

$md5Response = "realm=$server,nonce=$nonce,qop=$qop,charset=$charset,algorithm=$algorithm,xmpp,$server,$user,$pass";

I cannot seem to find what format should be included in the TLS response after I get the challenge. Where can I find that info?

Say I was doing it in PHP, should it look like:

$nonce = "somenoncevaluehere";
$qop = "auth";
$charset = "utf-8";
$algorithm = "md5-sess";
$server = "example.com";
$user = "bob";
$pass = "somepass";

$md5Response = "realm=$server,nonce=$nonce,qop=$qop,charset=$charset,algorithm=$algorithm,xmpp,$server,$user,$pass";

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的背包 2024-10-13 10:55:34

我找到了 cocoa 版本

NSMutableString *buffer = [NSMutableString stringWithCapacity:100];
[buffer appendFormat:@"username=\"%@\",", username];
[buffer appendFormat:@"realm=\"%@\",", realm];
[buffer appendFormat:@"nonce=\"%@\",", nonce];
[buffer appendFormat:@"cnonce=\"%@\",", cnonce];
[buffer appendFormat:@"nc=00000001,"];
[buffer appendFormat:@"qop=auth,"];
[buffer appendFormat:@"digest-uri=\"%@\",", digestURI];
[buffer appendFormat:@"response=%@,", [self response]];
[buffer appendFormat:@"charset=utf-8"];

NSLog(@"decoded response: %@", buffer);

NSData *utf8data = [buffer dataUsingEncoding:NSUTF8StringEncoding];

return [utf8data encodeBase64];

I found a cocoa version

NSMutableString *buffer = [NSMutableString stringWithCapacity:100];
[buffer appendFormat:@"username=\"%@\",", username];
[buffer appendFormat:@"realm=\"%@\",", realm];
[buffer appendFormat:@"nonce=\"%@\",", nonce];
[buffer appendFormat:@"cnonce=\"%@\",", cnonce];
[buffer appendFormat:@"nc=00000001,"];
[buffer appendFormat:@"qop=auth,"];
[buffer appendFormat:@"digest-uri=\"%@\",", digestURI];
[buffer appendFormat:@"response=%@,", [self response]];
[buffer appendFormat:@"charset=utf-8"];

NSLog(@"decoded response: %@", buffer);

NSData *utf8data = [buffer dataUsingEncoding:NSUTF8StringEncoding];

return [utf8data encodeBase64];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文