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

Unable to use self signed certificate #75

Open
miky9090 opened this issue Aug 20, 2017 · 0 comments
Open

Unable to use self signed certificate #75

miky9090 opened this issue Aug 20, 2017 · 0 comments

Comments

@miky9090
Copy link

miky9090 commented Aug 20, 2017

I have a spring based authorization server running on my pc with self signed certificate.
In this case I'm unable to connect to the authorization server.

I get the following exception:

I/X509Util: Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

I have created the following controller object with setting the webView's WebViewClient:

AuthorizationUIController controller = new DialogFragmentController(getFragmentManager(), true) {
	@Override
	public String getRedirectUri() throws IOException {
		return REDIRECT_URI;
	}

	@Override
	public boolean isJavascriptEnabledForWebView() {
		return true;
	}

	@Override
	public boolean disableWebViewCache() {
		return false;
	}

	@Override
	public boolean removePreviousCookie() {
		return false;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View oauthLoginLayout = inflater.inflate(R.layout.oauth_login_layout, container, false);
		WebView webView = (WebView) oauthLoginLayout.findViewById(android.R.id.primary);
		if(webView != null) {
			webView.setWebViewClient(new WebViewClient() {
				public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
					handler.proceed();
				}
			});
		}
		return oauthLoginLayout;
	}
};

But this has no effect, because in OAuthDialogFragment's onViewCreated method, the webView's WebViewClient is being set, so my custom WebViewClient is never used.

There should be an option to enable self signed certificates for the webview for testing purposes.

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

1 participant