Swift将SSL证书添加到Urlrequest
我正在尝试控制我的应用程序中的菲利普斯色调灯。 无论如何,他们都有一个API,我们可以控制所有这些。 问题在于,在软件邮递员(测试)上,他们说要禁用“ SSL证书验证”。 当我尝试在我的应用程序中与urlrequest致电时,相同的URL是:“ https://< ip_address_of_hue_bridge>/clip/v2/resource/device”,我会得到此错误:
domain = kcferrordomaincfnetwork代码= -1202 NSlocalizedDescription =该服务器的证书无效。您可能正在连接到假装为“< ip_address_of_hue_bridge>”的服务器。这可能会使您的机密信息处于危险之中。
在Phillips Hue开发人员门户网站上,他们给了我一些看起来像.cert证书的东西,但我不知道如何将其与Xcode一起使用。
I'm trying to control my Phillips hue lights from my app.
Anyway they have an Api where we can control all of that.
The issue is that on the software Postman (to test) they say to disable "SSL Certificate Verification".
When I try to call with URLRequest in my app the same url which is: "https://<ip_address_of_Hue_bridge>/clip/v2/resource/device" well, I get this error:
Domain=kCFErrorDomainCFNetwork Code=-1202
NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “<ip_address_of_Hue_bridge>” which could put your confidential information at risk.
On the the Phillips Hue Developer portal they gave me something that look like the .cert certificate, but I don't know how to use it with Xcode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为,更好的方法是忽略色调的SSL证书。在这里看。
https://stackoverflow.com/a/a/59484010/12277616
我强烈建议您在Xcode中删除SSL连接。
I think that the better way for you is to ignore the SSL certificate of the Hue. Give a look here.
https://stackoverflow.com/a/59484010/12277616
I strongly suggest you to not disable SSL connection in Xcode.