钛-“此服务器的证书无效。您可能正在连接到假装为DOMAIN.COM的服务器” [英] Titanium - "The certificate for this server is invalid. You might be connecting to a server that is pretending to be DOMAIN.COM”

查看:860
本文介绍了钛-“此服务器的证书无效。您可能正在连接到假装为DOMAIN.COM的服务器”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Titanium Appcelerator开发适用于iOS的应用程序。
我正在努力确保与服务器的连接安全。我购买了UCC证书来保护我的服务器(和其他网站)并安装了它。当我使用任何浏览器时,都会显示该连接是安全的。

I am developing an app for iOS using Titanium Appcelerator. I am struggling with securing the connections to my server. I bought a UCC certificate to protect my server (and other websites) and installed it. When I go on any browser, it displays that the connection is secured.

现在,当我尝试创建从应用程序到服务器的连接时,我得到以下信息错误:

Now, when I try to create a connection from the app to my server, I get the following error:


此服务器的证书无效。您可能正在连接到假装为DOMAIN.COM的
a服务器。

The certificate for this server is invalid. You might be connecting to a server that is pretending to be DOMAIN.COM

我已经尝试过使用其他安全域,而且效果很好。
我正在使用Ti.Network.createHTTPClient创建我的连接。
对这个问题有人有想法吗?

I've tried with other secured domains, and it works fine. I am using Ti.Network.createHTTPClient to create my connections. Does anyone have any idea about that problem? Is there something I'm missing here?

推荐答案

我找到了我拒绝连接的原因。问题是我没有将Godaddy提供的两个证书文件串联在一起,这在浏览器上似乎不是问题,但是却打破了该应用程序的信任链。更正该部分后,使用以下方法解决了该问题:

I found the reason why in my case the connection was refused. The catch was that I hadn't concatenated the two cert files given by godaddy, which doesn't seem to be a problem on browser, but was breaking the chain of trust for the app. Correcting that part fixed the issue, using:

cat gd_bundle-g1-g2.crt >> my_server.crt

创建完整的crt文件。

to create the full crt file.

注意:第一个cert文件可从Godaddy的网站上下载,但在下载crt文件时也将随附。

Note: The first cert file is downloadable on Godaddy's website, but is also attached when you download your crt file.

这篇关于钛-“此服务器的证书无效。您可能正在连接到假装为DOMAIN.COM的服务器”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆