언어&플랫폼/Android 2015. 6. 29. 20:07

인증모듈때문에 NICE ID 페이지와 연동하는 부분이 있었는데 키캣은 잘 동작하였으나 롤리팝에서 was loaded over HTTPS, but is submitting data to an insecure location at 와 같은 로그가 찍혔다.


TLS/SSL Default Configuration Changes

These changes may lead to breakages in HTTPS or TLS/SSL connectivity in a small number of cases listed below.
이러한 변화는 아래 의 경우 소수 HTTPS 또는 TLS / SSL 연결 의 파손 으로 이어질 수 있습니다.


5.0의 변화부분에 위와 같은 글이 있었고, 아래글과 같은 과정으로 해결을 하였다.





안드로이드 롤리팝 Webview 에서 발생한 문제들..
몇일전부터 안드로이드 5.0 버전으로 테스트중인 Nexus 5 에서 결제작업을 연동중에

문제점들이 발견되기 시작했다.

첫번째 : 의외로 간단하게 해결된 문제

HTTPS > HTTP 전송시 내장 브라우저에서 block 시켜 데이터 전송이 안되는 문제였다. 


[blocked] The page at 'https://xxx' was loaded over HTTPS, but ran insecure content from http://xxx.css': this content should also be loaded over HTTPS.


라는 메세지를 콘솔창으로 마구 뱉는 문제였다...

이 문제는 롤리팝에서 변경된 문제였다.

구글링 해보았으나 실제로 안드로이드 관련정보는 찾을수 없었고

해결방안은 Anroid 5.0 Changes 를 보고 찾을 수 있었다.

WebView



If your app targets API level 21 or higher:
  • The system blocks mixed content and third party cookies by default. To allow mixed content and third party cookies, use the setMixedContentMode() and setAcceptThirdPartyCookies() methods respectively.
  • The system now intelligently chooses portions of the HTML document to draw. This new default behavior helps to reduce memory footprint and increase performance. If you want to render the whole document at once, disable this optimization by calling enableSlowWholeDocumentDraw().
  • If your app targets API levels lower than 21: The system allows mixed content and third party cookies, and always renders the whole document at once.


혼합된 컨텐츠와 서드파티 쿠키가 설정에 따라 Webview 에서 Block 시키는 게 기본이 됬다는 내용이였다.


public abstract void setMixedContentMode (int mode)


Configures the WebView's behavior when a secure origin attempts to load a resource from an insecure origin. By default, apps that target KITKAT or below default to MIXED_CONTENT_ALWAYS_ALLOW. Apps targeting LOLLIPOP default toMIXED_CONTENT_NEVER_ALLOW. The preferred and most secure mode of operation for the WebView is MIXED_CONTENT_NEVER_ALLOW and use of MIXED_CONTENT_ALWAYS_ALLOW is strongly discouraged.


MIXED_CONTENT_ALWAYS_ALLOW : 항상 허용



MIXED_CONTENT_COMPATIBILITY_MODE : 호환성 모드



MIXED_CONTENT_NEVER_ALLOW : 허용 안함


해결 소스

if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
set.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
cookieManager.setAcceptThirdPartyCookies(mWeb, true);
}




http://developer.android.com/about/versions/android-5.0-changes.html#ssl

롤리팝(5.0) change log 를 살펴보시면

TLSv1.1과 TLSv1.2, AES-GCM(AEAD)가 지원되고

MD5, 3DES, ECDH등은 더이상 지원하지 않는다고 합니다.

TLS/SSL 기본 설정값이 달라졌기 때문에, 서버가 MD5나 3DES만 지원한다면, 이것을 먼저 고쳐야 한다는 내용인 듯 싶어요




참고, 펌

http://www.masterqna.com/android/40747/%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-%EB%A1%A4%EB%A6%AC%ED%8C%9D%EC%97%90%EC%84%9C-ssl-https-%ED%86%B5%EC%8B%A0%EC%9D%B4-%EC%95%88%EB%90%A9%EB%8B%88%EB%8B%A4

http://kalesst.blogspot.kr/2015/01/android-50-lollipop-webview-issue.html


posted by cozyboy
: