Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICS support #1

Open
Grosskopferter opened this issue May 15, 2012 · 5 comments
Open

ICS support #1

Grosskopferter opened this issue May 15, 2012 · 5 comments

Comments

@Grosskopferter
Copy link

Hey,
really nice project! However, for me it only works on pre-ICS devices,
the certificate is not sent on ICS devices.

@yonekawa
Copy link
Owner

Sorry, I'm too late.

I tried to support ICS over the last six months.
Yes, I found the method.

ICS added callback method onReceivedClientCertRequest for client certificate request.

public void onReceivedClientCertRequest( WebView view, ClientCertRequestHandler handler, String host_and_port )

By default this will cancle the request.
http://stackoverflow.com/questions/10683643/webview-with-ssl-client-certificate-on-android-4-ics

I override it and proceed certificate request.
Get certificates and privateKey from KeyStore.
I can load web page with client certificate request!

However the method uses private Class.
I need to create custom android.jar contains internal class.
Because it uses override callback method with private class type.

You need to read following references
https://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-2-hacking-around/
https://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-3-custom-android-platform/

You don't need this step. Eclipse is kept clean.
https://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-4-customizing-adt/

@yonekawa
Copy link
Owner

I committed ICS support code into ClientCertificateWebViewClient.java
However it can't compile if you don't use custom android.jar.
So, I commented out.

If you created custom android.jar, please uncomment it.

@coolalok
Copy link

Hi Yonekawa. I followed all the steps to create a custom Android.jar with internal classes. However i am not getting a callback for onReceivedClientCertRequest. Any suggestions ?

@lovecode2010
Copy link

I think because you are using the version that does not support this hidden method. I learned that this method did not supported from 4.2 version.
Find: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.2_r1/android/webkit/WebViewClient.java/
@yonekawa : Is there another way to implement Client Cert with WebView? I also care about it.

@surlac
Copy link

surlac commented Apr 10, 2014

@lovecode2010 Can we use WebView from 4.1.2 on devices with API >=4.2? I believe it should be possible to include WebView.java (+all dependencies), and refer to it as <org.custom.WebView> in layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants