2016-07-26 3 views
0

저는 Alamofire 프레임 워크를 프로젝트 테스트에 사용합니다.유닛 테스트에서 Alamofire의 ServerTrustPolicy.certificatesInBundle을 얻으려면 어떻게해야합니까?

간단한 프로젝트에서 Alamofire의 ServerTrustPolicy.certificatesInBundle을 호출하여 certificat 서버 목록을 가져올 수 있습니다.

하지만 프로젝트 테스트에서 어떻게 할 수 있습니까? ServerTrustPolicy.certificatesInBundle은 항상 인증서를 반환하지 않습니다.

답변

0

CertificatesInBundle은 인증서가 DER로 표시 될 것으로 예상합니다. PEM이있는 경우 다음 OpenSSL 명령을 사용하여 DER로 변환 할 수 있습니다.

openssl x509 -outform der -in yourcertificate.pem -out yourcertificate.der

관련 문제