Skip to content

Android SSL exception when using the package. #2

@kiamajuliet

Description

@kiamajuliet

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);
...
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions