BackWPup: SSL3_GET_SERVER_CERTIFICATE: certificate verify failed

I backup database daily, and send multiple copies to different locations. One is my Amazon S3 bucket for backups. If backup task failed, a notification email will be sent to me. And I am getting notification email of this sort recently, constantly from one website. One time isolated failure can be ignored for temporary cause (bad connection for example), not continuous failures.

Tracking back to dashboard, on the plugin setting page for S3 in the failing database backup task, I found the following error message:

[curl] 60: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed [url] https://s3.amazonaws.com/.

Apparently, this is a SSL certificate related issue. The very website having this error is running on WordPress 4.1 beta2, which is upgraded from 4.1 beta1 few days ago. I list this as one possible cause following troubleshooting rule, but don’t really think this is the root of the problem. The real cause is quickly addressed after just few round of search.

The plugin author claims that, this problem depends on the server’s SSL configurations. He has a fix for issue, which is not included in the latest version (BackWPup v3.1.4). You can download it here: backwpup-disable-ssl-verify.zip.

If you can’t download for any reason, here is the code:

<?php
/**
 * Plugin Name: BackWPup disable SSL connection verifying
 * Plugin URI: https://marketpress.com/
 * Description: Disables the verifying from SSL connections in backup destinations
 * Author: Inpsyde GmbH
 * Author URI: http://inpsyde.com
 * Version: 0.1
 * Network: true
 * License: GPLv3
 * License URI: http://www.gnu.org/licenses/gpl-3.0
 */

add_filter( 'backwpup_cacert_bundle', 'backwpup_disable_ssl_verify' );
function backwpup_disable_ssl_verify ( $file ) {

	return FALSE;
}

After activating the (add-on) plugin, it solved the problem. A test run sends the latest database backup to S3 bucket as expected.