반응형

지난 WWDC에서 iOS 9가 발표되면서 apple developer 사이트에도 iOS 9 베타 버전이 공개되었는데요,

 

그래서인지 벌써부터 iOS 9 베타를 설치하시는 분들이 많이 계시더군요.

 

그런데 iOS 9로 업데이트한 후 운영 중인 앱이 사용할 수 없다는 VOC가 들어오더군요.

 

마침 xcode 7 베타 버전도 같이 공개되어 부랴부랴 다운로드 받아서 설치해 봤습니다.

 

시뮬레이터로 확인해 보니

 

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

CFNetwork SSLHandshake failed (-9824)

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)

Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."

 

secure connection 이 필요하다는 메시지가 나오네요.

 

검색을 해보니 iOS 9.0 이상에서는 ATS(App Transport Security)라는 기술이 나오네요.

 

결론은 app - web 간 connection 에서는 secure connection 이 기본값이라는 ....

 

그런데 서버가 특A급은 아니다 보니.... 아무래도 SSL 암복호화 부하를 무시할 수는 없어서....

 

로그인이 필요 없는 일부 기능만이라도  SSL을 좀 피해보려고....

 

관련 내용을 찾아 봤습니다.

 

찾아보니 info.plist 에서 예외 처리를 할 수 있더군요.

 

NSAppTransportSecurity > NSAllowsArbitraryLoads : true 로 설정하면 ATS 를 비활성화 할 수 있습니다.

 

 

 

또는

 

 

 

 

다시 리빌드 해보니 정상적으로 사용이 가능하네요.

 

조금이나마 도움 되시기를....

 

※ 참고

 

https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html

 

https://github.com/facebook/react-native/issues/1563

반응형
반응형

apache 에서 mod_rewrite 모듈을 이용해
특정 페이지를 redirect 하는 방법입니다.

검색을 해 보면 일반적으로
.htaccess 파일을 생성하여 사용하라고 되어 있는데,

apache 스펙 문서를 보면
.htaccess 는 과도한 디스크 접근이 발생하므로
특수한 경우가 아니라면 사용을 피하라고 하고 있습니다.
아파치 튜토리얼: http://httpd.apache.org/docs/2.2/en/howto/htaccess.html

저는 httpd.conf 에 설정하는 방식을 사용했습니다.

<VirtualHost *:80>
Servername      www.mydomain.com
...
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/user/login(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R, L]
</IfModule>
</VirtualHost>

이렇게 설정하면 /user/login... 으로 시작하는 페이지들의 경우에는
아파치 단에서 https 로 강제 redirect 되게 됩니다.


사용한 변수들)
RewriteEngine: rewrite 모듈의 사용 여부 [On/Off]
RewriteCond: rewrite 실행할 조건
RewriteRule: 조건이 만족할 경우 실제로 rewrite가 일어날 원본 주소와 rewrite 된 주소

%{HTTPS} : SSL 사용 여부 [on/off] - mod_ssl 필요
%{HTTP_HOST} : 호출된 서버의 domain. 포트 번호 있을 경우에는 port 번호 포함.
  ex) http://www.mydomain.com/myurl.html?var=value => www.mydomain.com
%{REQUEST_URI} : 도메인 이후의 리소스 절대 경로 및 파라미터
  ex) http://www.mydomain.com/myurl.html?var=value => /myurl.html?var=value
[R] : 강제로 redirect 시킴 (http status code에 따라 분기할 수 있습니다.)
[L] : 마지막 RewriteRule 표시. (이후의 RewriteRule은 무시됨)


제가 사용한 옵션은 이 정도입니다.

보다 다양한 내용은 아파치 document에서 확인해 보세요 ^^
Apache Module mod_rewrite: http://httpd.apache.org/docs/2.2/en/mod/mod_rewrite.html

반응형

+ Recent posts