I have finally found working solution. In my case adding end-user certificate or intermediate certificate, (separately or together), makes everything working. End-user cert is short term so I advice to add long term intermediate certificate.
Add:
android:networkSecurityConfig="@xml/network_security_config"
to manifest in application section.
Add new xml file (build action AndroidResource) to Resources -> xml -> network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="@raw/untrusted_ca"/>
<certificates src="system"/>
</trust-anchors>
</base-config>
</network-security-config>
Name of certificate should consist of only lower case letters, numbers and underscore.
Add certificate (build action: AndroidResource) in: Resources -> raw -> untrusted_ca.pem
Now android webview trusts server on application level so no more ssl error occurs, when connecting to particular server.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…