我需要为Android中的Retrofit添加SSL证书,但我无法使用Google的示例代码找到该文件。
以下是我使用https://developer.android.com/training/articles/security-ssl
的Google示例运行时:
val caInput: InputStream = BufferedInputStream(FileInputStream("rest_of_the_world_production.crt"))
我收到错误
Caused by: java.io.FileNotFoundException: rest_of_the_world_production.crt: open failed: ENOENT (No such file or directory)
,尝试访问文件时立即崩溃。该文件当前作为crt文件存储在res / raw / rest_of_the_world_production.crt下,所以Android为什么找不到它?