简体   繁体   English

在OSX 10.5.8上的Qt:“为此目的不信任根CA证书”

[英]Qt on OSX 10.5.8: “The root CA certificate is not trusted for this purpose”

I have a Qt application which succeeds in making an HTTPS request to our website on OSX 10.7, but fails on 10.5.8 with the QSslError::errorString "The root CA certificate is not trusted for this purpose". 我有一个Qt应用程序成功向OSX 10.7上的我们的网站发出HTTPS请求,但在10.5.8上使用QSslError :: errorString失败“根CA证书不被信任用于此目的”。

I am setting the root certificate with: 我正在设置根证书:

QFile certFile1(":/Equifax_Secure_Certificate_Authority.pem.txt");
QSslCertificate cert1(&certFile1, QSsl::Pem);
certList.append(cert1);

QSslConfiguration sslConfig(request.sslConfiguration());
sslConfig.setCaCertificates(certList);
request.setSslConfiguration(sslConfig);

If I set some other certificate, I get two error strings "The issuer certificate of a locally looked up certificate could not be found" AND "The root CA certificate is not trusted for this purpose", on both OSX 10.5.8 and 10.7. 如果我设置了一些其他证书,我会在OSX 10.5.8和10.7上得到两个错误字符串“无法找到本地查找证书的颁发者证书”和“根CA证书不可信任”。 This is what I'd expect. 这是我所期待的。

What makes Qt not trust the Equifax certificate only on 10.5.8? 是什么让Qt不再仅仅信任10.5.8上的Equifax证书?

EDIT: Possible clue (or red herring): looking at the respective WireShark traces, the 10.5.8 client doesn't include Server Name Indication or Session Ticket TLS extensions in its client hello handshake. 编辑:可能的线索(或红色鲱鱼):查看相应的WireShark跟踪,10.5.8客户端在其客户端hello握手中不包括服务器名称指示或会话票证TLS扩展。

EDIT 2: Building as 32-bit on 10.5.8 works. 编辑2:在10.5.8工作时构建为32位。 Also, building as universal (32 and 64-bit Intel) on 10.7 and running on 10.5.8, linking against 32-bit Qt libraries built on 10.5.8 works. 此外,在10.7上构建为通用(32位和64位Intel)并在10.5.8上运行,链接到基于10.5.8构建的32位Qt库。

EDIT 3: I have placed an example at https://github.com/cdemel/SO_examples/tree/master/soqtssl , using a different website (Twitter) and root cert, with the same behavior. 编辑3:我在https://github.com/cdemel/SO_examples/tree/master/soqtssl上放置了一个示例,使用不同的网站(Twitter)和根证书,具有相同的行为。

Well, this has been unanswered for too long, so I'm going to give my uninformed solution as the answer: 好吧,这已经很长时间没有答案了,所以我将把我不知情的解决方案作为答案:

Have the app link to Qt libraries built on 10.5.8. 将应用程序链接到基于10.5.8构建的Qt库。 This worked for me, but I can't tell you why. 这对我有用,但我不能告诉你为什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM