在开发期间,我的服务器使用的是自签名CA证书。生产服务器将使用真实证书。
在 iOS 中,我可以简单地将证书拖到模拟器中,从那时起它就会被信任。
对于Android,我找到的所有解决方案都涉及代码。我不想在我的应用程序中插入代码只是为了我的测试。是否有与 iOS 提供的解决方案类似的解决方案?
最佳答案
Is there a similar solution to what iOS offers?
没有。
I don't want to insert code in my application just for my testing.
当然欢迎您使用依赖注入(inject)等技术,让您更轻松地在不同的构建类型中拥有替代配置。
During the development period, my server uses a Self-signed CA certificate.
请注意,常规 SSL 证书相当便宜。
关于Android 在测试期间信任自签名证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35033769/