http icon indicating copy to clipboard operation
http copied to clipboard

Support badCertificateCallback in cronet

Open komaxx opened this issue 1 year ago • 1 comments

It's quite common in larger business intranets that connections are only secured by self-signed certificates. To enable secure communication inside such networks, we're currently relying on HttpClient's badCertificateCallback.

That works well - but for http2 support and honoring of proxies set on device level, we would like to switch to cronet for Android. However, in our tests, the badCertificateCallback is never invoked. Instead attempted requests simply fail with a ClientException:

ClientException: Cronet exception: m.mb: Exception in CronetUrlRequest: net::ERR_CERT_AUTHORITY_INVALID, ErrorCode=11, InternalErrorCode=-202, Retryable=false, uri=https://self-signed.badssl.com/

Is it possible to support the badCertificateCallback with cronet? Or is there an alternative way to accept self-signed certificates?

komaxx avatar Oct 07 '24 09:10 komaxx

I don't think that is possible using the cronet API

brianquinlan avatar Oct 17 '24 19:10 brianquinlan