Debug builds and SSL certificate validation

Hi,

We are experiencing issues with SSL certificates on some endpoints. When the root CA or intermediate CA chain is not provided, older Android versions may reject the certificate.

Adb log:

[ERROR:net/socket/ssl_client_socket_impl.cc:896] handshake failed; returned -1, SSL error code 1, net_error -202
(ERR_CERT_AUTHORITY_INVALID)

The main issue is that debug builds connect successfully anyway, while release builds fail.

This makes debugging difficult, because no one becomes aware of the problem until the app is ready for release.

Is there any way to compile debug builds so that they behave the same as release builds in this scenario?

I found this post on Stack Overflow:

Can this solution be applied with VoltBuilder?

Thanks in advance

D.

Thanks for reporting this! I understand the issue and yes, I believe we can provide a fix for this. I think we can get something working this week.

We’re in the process of making a plugin that you can include in your project that will disable the SSL bypass. I’ll post here once it’s tested and published.

The plugin has been released - please give it a try and let me know if you have any problems with it:

@voltbuilder/cordova-plugin-android-debug-ssl-bypass-disable - npm

Thanks, we’ll give it a try

D.

Hi, the plugin did not work for me. My app works great in android 15 but i get error on android 13 (debug version works, release version does not):

[ERROR:net/socket/ssl_client_socket_impl.cc:962] handshake failed; returned -1, SSL error code 1, net_error -202

The plugin is designed to enforce SSL checks in debug builds (they normally are ignored). Could you open a new thread describing exactly the issue you are having and include a build ID? Thank you!