iPhone 上的 gSOAP 和 OpenSSL
这是我在 stackoverflow 上的第一篇文章。希望我没有打扰任何人......:)
我已经使用 gSOAP 连接到我的 iPhone 应用程序的 http-web 服务有一段时间了。现在我正在尝试切换到 https-webservice。我在项目中包含了 openssl 并添加了compileflat -DWITH_OPENSSL。构建和运行正在运行,但不幸的是 openssl 不允许我验证网络服务器证书。
打开DEBUG-MODE,我发现网络服务器证书有问题:
SSL 验证错误或警告 深度1的证书:无法获取 本地颁发者证书 证书 发行人 /C=US/O=VeriSign, Inc./OU=Class 3 公共初级认证 权威证书主题 /O=VeriSign 信任网络/OU=VeriSign, Inc./OU=VeriSign 国际服务器 CA - 3 类/OU=www.verisign.com/CPS Incorp.by Ref.责任有限公司(c)97 威瑞信
使用 SSL Shoppers SSL Checker 进行检查会导致:
该证书应受信任 所有主要网络浏览器(所有 正确的中间证书是 已安装)。
关于如何解决这个问题有什么想法吗?
BR
马丁
this is my first post on stackoverflow. Hopefully I am not disturbing anybody... :)
I've been working with gSOAP connecting to a http-webservice for my iPhone App for a while now. Now I am trying to swith to a https-webservice. I included openssl within the project and added the compileflat -DWITH_OPENSSL. Build&Run is working but unfortunatly openssl won't let me verify the webservers certificate.
Turning DEBUG-MODE on, I found that there is an issue with the webservers certificate:
SSL verify error or warning with
certificate at depth 1: unable to get
local issuer certificate certificate
issuer /C=US/O=VeriSign, Inc./OU=Class
3 Public Primary Certification
Authority certificate subject
/O=VeriSign Trust Network/OU=VeriSign,
Inc./OU=VeriSign International Server
CA - Class 3/OU=www.verisign.com/CPS
Incorp.by Ref. LIABILITY LTD.(c)97
VeriSign
Checking with SSL Shoppers SSL Checker results in:
The certificate should be trusted by
all major web browsers (all the
correct intermediate certificates are
installed).
Any ideas on how to solve that issue?
BR
Martin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,有时 RTFM 确实有帮助:)
第 19.20 节(使用 HTTPS/SSL 保护 SOAP 客户端)写道:“要出于测试目的禁用服务器身份验证,请使用以下内容:”
不幸的是,-DSOAP_DEBUG 选项仍然显示“SSL 验证错误或证书警告”深度 1:无法获取本地颁发者证书”。无论如何,它现在正在发挥作用。
well, sometimes RTFM really helps :)
Section 19.20 (Secure SOAP Clients with HTTPS/SSL) reads: "To disable server authentication for testing purposes, use the following:"
Unfortunatly, -DSOAP_DEBUG option still reads "SSL verify error or warning with certificate at depth 1: unable to get local issuer certificate". Anyway, it is working now.
禁用身份验证不是正确的解决方案。我怀疑您没有设置 openssl 用于信任 CA 的 ca 证书文件路径。
soap_ssl_client_context(&soapObject, SOAP_SSL_DEFAULT, NULL, NULL, cacerts.pem, NULL, NULL))
您可以从 mozilla 获取 cacerts.pem。如果您的应用程序只允许连接到一个网站,那么您应该只保留颁发网站证书的 CA 的哈希值,并从 pem 文件中删除所有不需要的 ca。
Disabling the Auth is not the right solution. I suspect you are not setting the ca certificates file path that openssl uses to trust CA's.
soap_ssl_client_context(&soapObject, SOAP_SSL_DEFAULT, NULL, NULL, cacerts.pem, NULL, NULL))
you can get cacerts.pem from mozilla. if your app only allows connecting to one website, then you should just leave the hash for the CA that website certificate is issued by and remove all the unneeded ca's from the pem file.