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

Android SSL exception when using the package. #2

Open
kiamajuliet opened this issue Sep 7, 2022 · 0 comments
Open

Android SSL exception when using the package. #2

kiamajuliet opened this issue Sep 7, 2022 · 0 comments

Comments

@kiamajuliet
Copy link

Error details
The SSL connection could not be established,
Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Cause/Explanation:
https://docs.microsoft.com/en-us/answers/questions/535932/xamarin-android-throws-error-ssl-routinesopenssl-i.html

Proposed Solution
Pass HttpClientHandler to Html.LoadAsync and use that handler to add-on as required e.g.
public async Task LoadAsync(Uri uri, HttpClientHandler handler, CancellationToken cancel = default)
{
// UAP apps forbid redirect from HTTPS to HTTP, we must manually redirect to avoid this issue
handler.AllowAutoRedirect = false;
handler.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
handler.UseCookies = true;
using (handler)
{
var wc = new HttpClient(handler);
...
}
}

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