如何确定连接在 mod_perl 中使用哪个 SSL 客户端证书?

发布于 2024-07-16 05:48:17 字数 133 浏览 4 评论 0原文

我正在 Perl 中编写一个 Web 服务,该服务将在带有客户端证书的 SSL (HTTPS) 下运行。 如何确定客户端在当前连接中使用哪个证书,以便过滤掉不需要的证书?

注意:Web 服务作为 mod_perl 脚本运行。

I am writing a web service in Perl that will run under SSL (HTTPS) with client certificates.
How can I determine which certificate is being used by the client in the current connection so I can filter out unwanted ones?

Note: the web service is being run as a mod_perl script.

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

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

发布评论

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

评论(1

红尘作伴 2024-07-23 05:48:17

PerlMonks 上找到答案:

使用 Apache::SSLLookup 模块

  sub handler {
    my $r = Apache::SSLLookup->new(shift);
    my $request_is_over_ssl = $r->is_https;
    my $certificate = $r->lookup_var('SSL_CLIENT_CERT');

    ...
  }

mod_ssl 环境参考 此处

Found the answer on PerlMonks:

Use the Apache::SSLLookup module

  sub handler {
    my $r = Apache::SSLLookup->new(shift);
    my $request_is_over_ssl = $r->is_https;
    my $certificate = $r->lookup_var('SSL_CLIENT_CERT');

    ...
  }

mod_ssl environment reference here.

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