Skip to content

Maui -Android certificate pinning using network-security-config ignore incorrect pin #107695

@DmitryNikiforovCoherent

Description

@DmitryNikiforovCoherent

Description

Added ssl pinning using network-security-config

For test change one letter of base 64 pin, but SslClientAuthenticationOptions.RemoteCertificateValidationCallback still pass SslPolicyErrors.None

Steps to Reproduce

  • Added network_security_config.xml as AndroidResource <network-security-config> <domain-config> <domain includeSubdomains="true">{host}</domain> <pin-set expiration="2025-03-21"> <pin digest="SHA-256">pin</pin> </pin-set> </domain-config> </network-security-config>

  • Added SocketsHttpHandler with SslClientAuthenticationOptions.RemoteCertificateValidationCallback

  • I expect, that if I change base64 pin to incorrect, RemoteCertificateValidationCallback will be called with RemoteCertificateNameMismatch, as for IOS, but receive SslPolicyErrors.None

Link to public reproduction project repository

No response

Version with bug

8.0.70 SR7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Any android version

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions