4

I have an app that displays a warning to the user when they attempt to contact a server with a self-signed or otherwise untrusted SSL certificate. If they choose to proceed, we use connection:didReceiveAuthenticationChallenge to continue with the HTTPS request by creating a credential for the server trust. This is the common way that connections are made to untrusted servers on iOS.

What I'm wondering if there's a way to only create this server trust for a particular connection, or if it's possible to rescind the trust at a later time. What we've found is that the server trust lasts for as long as the app is running. We'd like to be able to prompt the user again at a later time to make sure they still want to proceed. Is this possible? Is there a way for the trust to only "last" for one connection, or to find the trust and somehow remove it so that we go through the process again for that same server?

4

1 回答 1

0

收到数据后你不释放连接吗?如果您要发布它,它应该每次都询问。确保未启用连接的缓存属性

于 2012-12-19T17:39:01.013 回答