iOS HTTPS SSL证书 [英] iOS HTTPS SSL Certificates

查看:85
本文介绍了iOS HTTPS SSL证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景,我正在开发一个需要使用 https 进行网络通信的应用程序.目前,我们的用户凭据(用户名,密码...)正以纯文本格式通过我们的URL发送.(例如 http://www.myserver.com/service?username = USERNAME& password = PASSWORD ... ).这对我们的客户不利.我是使用 https 的新手,甚至还不熟悉设置iOS应用程序以使用 https 的手.所以我有几个问题:

Scenario I am working on an application that needs to make use of https for network communication. Currently our user credentials (username, password...) are being sent in plain text over our URL. (ex. http://www.myserver.com/service?username=USERNAME&password=PASSWORD...). This is not good for our client. I am new to using https and even newer to setting up an iOS app to use https. So I have a few questions:

假设 :我认为iOS应用必须包含SSL证书,然后才能在服务器端进行验证.如果我错了,请纠正我.

assumption: I believe an iOS app must contain an SSL certificate to then be validated on the server side. Correct me if I'm wrong.

1):在哪里/如何获得证书?

1) Where/How do I get a certificate?

2)如何将证书导入到应用程序中?

2) How do I import the certificate into the application?

3)如何使用服务器之一验证证书?

3) How do I validate the certificate with the one of server?

4)如果证书被视为无效,我该如何解决?

4) If the certificate is deemed invalid, how do I work around that?

如果有任何我想念或误解的地方,请纠正我.

And if there is anything I am missing or misunderstanding please correct me.

推荐答案

您的iOS应用无需包含SSL证书.相反,它是需要SSL证书的服务器.在iOS应用程序端,您只需将http://URL替换为https://URL.当您的应用与服务器建立https连接时,iOS的网络代码将检查服务器证书的有效性,因此您可以确定自己正在与正确的服务器通信.您通过https连接发送的任何内容都将受到加密保护,以防窃听.

Your iOS app does not need to contain an SSL certificate. Instead, it is the server that needs an SSL certificate. On the iOS app side you only need to replace the http:// URL with an https:// URL. When your app makes the https connection to the server iOS's networking code will check the validity of the server's certificate, so you can be confident that you are communicating with the right server. Anything you send over the https connection will be protected from eavesdropping by encryption.

您可以通过在Web浏览器中输入其https://URL来测试服务器是否具有证书.如果浏览器显示一个锁定图标,则服务器具有有效的证书.您可以单击锁图标以获取有关服务器证书的更多信息.

You can test whether the server has a certificate by entering its https:// URL into a web browser. If the browser displays a lock icon, the server has a valid certificate. You can click on the lock icon for more information about the server's certificate.

这篇关于iOS HTTPS SSL证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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