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

Seeking ground truth on TLS certificates and MacOS - browser, curl, openssl compared

· 52CE 我爱测

On a Mac, High Sierra 10.13.5, I'm seeing a difference in TLS certification validation. Chrome and Safari are happy with TLS validation when visiting https://www.visitflorida.com . Also, curl has no complaints and I am NOT using …

问题原文

原帖链接 · Kevin Buchs · CC BY-SA 4.0

On a Mac, High Sierra 10.13.5, I'm seeing a difference in TLS certification validation. Chrome and Safari are happy with TLS validation when visiting https://www.visitflorida.com. Also, curl has no complaints and I am NOT using '-k'. However, openssl complains that it cannot find the intermediate certificate when trying this openssl s_client -connect www.visitflorida.com:443 < /dev/null | openssl x509 -subject -noout. I have used both the base openssl and brew-installed one.

I have tried to add in -CAfile intermediate.pem (where I downloaded the intermediate certificate from TrustWave). Even though the intermediate certificate does not appear anywhere in my KeyChain, I have exported my KeyChain System Roots into a single file and tried that via -CAfile also. Nothing is working. The only filesystem location I see certificates is /etc/ssl/cert.pem and when I specify that via -CAfile, it still fails.

Someone has suggested that my browsers and curl have a looser requirement for TLS validation than openssl. Is that really the case? I have a hard time believing it. Can anyone help me explain this behavior?

BTW, I know this can be resolved by including the intermediate certificate with the endpoint certificate on the TLS endpoint for www.visitflorida.com. Now if we could just find that missing key file!

Browser happiness:

Curl log:

已采纳解答

原帖链接 · garethTheRed · CC BY-SA 4.0

Browsers, such as Internet Explorer/Edge, Chrome and Safari will look at the AIA extensions's caIssuer field for an URL from where it can download a superior CA's certificate if one is not provided by the server during the TLS handshake.

Your website's certificate has a caIssuer field set to http://ssl.trustwave.com/issuers/OVCA2_L1.crt therefore all the above browsers will download it from that URL and use it to build the chain.

Command line tools such as OpenSSL's s_client won't use the caIssuer to download this additional certificate, hence the situation you witnessed. If you were to try Mozilla Firefox, you'd notice the same there too as Mozilla refuse to use this extension.

The caIssuer field ends up cloaking the real issue, which is bad server admin. RFC 5246 Section 7.4.2 dictates that the server must send a certificate_list consisting of its own certificate followed by any intermediate CA certificates.

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

资料来源与适用范围

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

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

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