我已经用 PHP 编写了一个在 Apache 下运行的 IPP 服务器。使用标准的 IPP 客户端,它工作得很好。但是当我尝试从 iOS 设备打印时,当客户端尝试切换到 TLS 时,连接会中断。这似乎由 RFC 2817(在 HTTP/1.1 中升级到 TLS)涵盖,并且应该由 Apache 支持多年。我的 Apache 配置有什么问题?
Apache SSL 配置:
SSLEngine optional
SSLCertificateFile /path/to/server.crt
SSLCertificateKeyFile /path/to/server.key
Run Code Online (Sandbox Code Playgroud)
要求:
OPTIONS * HTTP/1.1
Connection: Upgrade
Host: iserv.local
Upgrade: TLS/1.0,SSL/2.0,SSL/3.0
User-Agent: CUPS/1.5.0
Run Code Online (Sandbox Code Playgroud)
回复:
HTTP/1.1 200 OK
Server: Apache/2.2.16
Content-Length: 0
Content-Type: text/plain
Run Code Online (Sandbox Code Playgroud)
预期回复:
HTTP/1.1 101 Switching Protocol
Server: CUPS/1.4
Connection: Keep-Alive
Keep-Alive: timeout=30
Connection: Upgrade
Upgrade: TLS/1.0,HTTP/1.1
Content-Length: 0
Run Code Online (Sandbox Code Playgroud)