2013-03-24 2 views
0

SSL을 사용하는 Ruby on Rails 앱이 있습니다. 나는 thin start --ssl을 사용하여 서버를 돌린다. 서버를 실행하고 앱에 액세스 할 때마다 SSL 인증서가 확인되지 않았다는 경고가 표시됩니다. Rails에 머무르는 한 문제가되지 않습니다. 그러나, 내 애플 리케이션은 또한 API를 가지고 있으며 그것을위한 아이폰 클라이언트 애플 리케이션을 개발하고 있습니다. 내가 로컬 레일 서버에 아이폰 응용 프로그램의 요청을 수행 할 때, 나는 다음과 같은 오류 얻을 : 내 생각에로컬 개발을위한 검증 된 SSL 인증서를 얻는 방법은 무엇입니까?

2013-03-24 12:30:09.680 OAuth2Test[44541:c07] Error: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “oauth.lvh.me” which could put your confidential information at risk." UserInfo=0x8832730 {NSErrorFailingURLStringKey= https://oauth.lvh.me:3000/oauth/authorize?client_id=23b8921e8db833a33ac7a058b93183a1496f56a6eea4f6c597291106f80a37d0&redirect_uri=https%3A%2F%2Fcatapultcentral.com%2FiOSClientCallback&response_type=code , NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey= https://oauth.lvh.me:3000/oauth/authorize?client_id=23b8921e8db833a33ac7a058b93183a1496f56a6eea4f6c597291106f80a37d0&redirect_uri=https%3A%2F%2Fcatapultcentral.com%2FiOSClientCallback&response_type=code , NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “oauth.lvh.me” which could put your confidential information at risk., NSUnderlyingError=0x8944cd0 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “oauth.lvh.me” which could put your confidential information at risk.", NSURLErrorFailingURLPeerTrustErrorKey=}

을,이 오류의 핵심 부분은 다음과 같습니다 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “oauth.lvh.me” which could put your confidential information at risk.". 그런데 iPhone 시뮬레이터에서 iPhone 앱을 테스트합니다.

  1. 스테이징 서버에 내 API를 배포하고 그에 대한 아이폰 응용 프로그램 개발 : 내가 올바른 오전 경우

    그래서,이 문제에 대한 세 가지 솔루션이 있습니다. 현재 모든 API 관련 코드는 배포되지 않으며 안정적인 상태가 될 때까지 배포하지 않습니다. 그래서 그것은 옵션이 아닙니다.

  2. iPhone 앱을 개발하여 SSL 인증서를 확인하지 않도록하십시오. 이 방법이 마음에 들지 않아 어떻게해야할지 모르겠다. ...
  3. 로컬 확인 (가짜로 확인 된 상태 또는 무엇인가). 나는 그것을하는 방법을 모른다. 그러나 그것은 최고의 옵션과 같게 보인다. (생성 된 SSL 인증서가 아직 확인되지 않음)

나는 자기 인증 SSL 인증서를 생성하는 방법에 대한 a tutorial에 따라 다음 thin start --ssl --ssl-verify --ssl-key-file server.key --ssl-cert-file server.crt으로 레일 서버를 실행하려고하지만, 작동하지 않았다.

내 문제를 어떻게 해결할 수 있습니까?

+0

루트 CA를 만들어이를 사용하여 SSL 인증서를 만들고 해당 루트 CA를 iPhone에 추가해야합니다. –

+0

답변 해 주셔서 감사합니다. 첫째, iPhone Simulator에서 내 앱을 테스트 해보니 더 복잡해졌습니다. 둘째로, 나는 당신이 제안한 것을하는 법을 모른다. –

+1

@grasGendarme 나는 당신의 충고와 문제가 해결 된 후에 몇 가지 연구를했다! [이 python 스크립트] (https://github.com/ADVTOOLS/ADVTrustStore)를 사용하고 있습니다. 동의 할 수 있도록 답변을 추가하십시오. 고마워요! –

답변

2

루트 CA를 만들어 SSL 인증서를 만들고이 루트 CA를 iPhone에 추가해야합니다.

관련 문제