I have installed my CA certificate on phone, and when i test app in debug mode it works fine with the following network security config
<network-security-config>
<debug-overrides>
<trust-anchors>
<certificates src="user"/>
</trust-anchors>
</debug-overrides>
But in release mode i tried multiple configs like
<base-config>
<trust-anchors>
<certificates src="@raw/cert" overridePins="true"/>
</trust-anchors>
</base-config>
or
<base-config>
<trust-anchors>
<certificates src="user" overridePins="true"/>
</trust-anchors>
</base-config>
or both at same time (user and raw resource)
bot in release mode it always ends with java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
like it is completly ignoring my certificate in release mode, what configuration should be used for release mode in order for app to be able to use this CA certificate?
CodePudding user response:
Turned out that you can't use certificate that is at the same time a CA certificate. You have to generate one cert to be CA and then sign cert for your server witht this CA, after this it started to work.