简体   繁体   English

iOS HTTPS SSL证书

[英]iOS HTTPS SSL Certificates

Scenario I am working on an application that needs to make use of https for network communication. 方案我正在开发一个需要使用https进行网络通信的应用程序。 Currently our user credentials (username, password...) are being sent in plain text over our URL. 目前,我们的用户凭据(用户名,密码...)以纯文本格式通过我们的URL发送。 (ex. http://www.myserver.com/service?username=USERNAME&password=PASSWORD... ). (例如, 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 . 我是使用https新手,甚至还比较新来设置iOS应用程序以使用https So I have a few questions: 所以我有几个问题:

assumption : I believe an iOS app must contain an SSL certificate to then be validated on the server side. 假设 :我认为iOS应用程序必须包含SSL证书,然后才能在服务器端进行验证。 Correct me if I'm wrong. 如果我错了纠正我。

1) Where/How do I get a certificate? 1)在哪里/如何获得证书?

2) How do I import the certificate into the application? 2)如何导入证书到应用程序?

3) How do I validate the certificate with the one of server? 3)如何使用服务器之一验证证书?

4) If the certificate is deemed invalid, how do I work around that? 4)如果证书被认为是无效的,我该如何解决?

And if there is anything I am missing or misunderstanding please correct me. 如果有任何我想念或误会的地方,请纠正我。

Your iOS app does not need to contain an SSL certificate. 您的iOS应用无需包含SSL证书。 Instead, it is the server that needs an SSL certificate. 相反,它是需要SSL证书的服务器。 On the iOS app side you only need to replace the http:// URL with an https:// URL. 在iOS应用程序端,您只需将http:// URL替换为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. 当您的应用与服务器建立https连接时,iOS的网络代码将检查服务器证书的有效性,因此您可以确信自己正在与正确的服务器通信。 Anything you send over the https connection will be protected from eavesdropping by encryption. 您通过https连接发送的任何内容都将受到加密保护,以防止被窃听。

You can test whether the server has a certificate by entering its https:// URL into a web browser. 您可以通过在Web浏览器中输入其https:// URL来测试服务器是否具有证书。 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. 您可以单击锁图标以获取有关服务器证书的更多信息。

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

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