大网数据广告活动
服务器运维问答

How to enable OCSP Stapling via http proxy?

· 52CE 我爱测

I'd like to utilize OCSP stapling for SSL certs on my Linux webservers running Apache httpd and Nginx. Both Nginx and Apache however per default do want to directly access the OCSP responder. However, my webservers are located be…

问题原文

原帖链接 · knoepfchendruecker · CC BY-SA 3.0

I'd like to utilize OCSP stapling for SSL certs on my Linux webservers running Apache httpd and Nginx. Both Nginx and Apache however per default do want to directly access the OCSP responder.

However, my webservers are located behind a loadbalancer using direct server return/direct routing, so my hosts have a public IP address configured and do receive and answer incoming traffic on those public IPs, but my servers can't use those public IPs for new, originating connections. The servers are running on a private (non-public IP space) network and don't have access to the public Internet via NAT, but via a HTTP proxy.

From a security perspective, this is perfectly fine. I don't want to introduce NAT on the network just for the sake of OCSP stapling and I'm perfectly fine to use a HTTP Proxy for OCSP requests (who are HTTP anyway).

The "best" solution for me simply where to configure Apache/Nginx to use the HTTP proxy for accessing OCSP responders - but as far as I see, there's no option to do so.

The closest options I came across are to

  • use Apache's SSLStaplingForceURL (which does simply override the x509 AIA endpoint) with a reverse proxy, who in turn does have public internet access. The reverse proxy's job is to rewrite the host-header and port with the actual OCSP responder and connect to that one.
  • use a local iptables rule to NAT locally originating traffic aimed at the OCSP responder to my local HTTP proxy. To fight a possibly changing IP address of an OCSP responder, I'll also add a static (fake) entry in /etc/hosts.

All those options don't look very fine to me and do have severe drawbacks (netfilter-NAT is based on IP; whenever the destination IP of the ocsp responder changes, I'll have to adjust my rules)- did I miss any more reasonable alternatives or the "right" config options in either Apache or Nginx?

已采纳解答

原帖链接 · Anatoly · CC BY-SA 3.0

You can try this: http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_stapling_file

When set, the stapled OCSP response will be taken from the specified file instead of querying the OCSP responder specified in the server certificate.

The file should be in the DER format as produced by the “openssl ocsp” command.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-07-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。