SSL3_GET_SERVER_CERTIFICATE: certificate verify failed

Monday, a shopping cart solution that has worked for years started throwing this error when connecting to Authorize.net

Could not connect to the specified payment gateway SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines: SSL3_GET_SERVER_CERTIFICATE: certificate verify failed

Why was curl trying to connect over SSL3 anyway? Looked at the code, no SSL protocol was selected so I figured time to upgrade. It was an old server anyway, Ubuntu 10.04. Upgraded to 12.04. No change. So upgraded to Ubuntu 14.04 and now we get a new error message. It is progress.

 Could not connect to the specified payment gateway SSL certificate problem: unable to get local issuer certificate

So, we are closer. Googled on this message and found info on curl.cainfo= and so i downloaded and set cacert.pem in php.ini but it didn’t help.

Finally got info from authorize net. It seems the Entrust certificate did not get downloaded with the upgrade to 14.04.

Here is how to fix it!

sudo wget --no-check-certificate https://www.entrust.net/downloads/binary/entrust_ssl_ca.cer -o /usr/local/share/ca-certificates/entrust_ssl_ca.crt 
sudo update-ca-certificates

This was a three hour ordeal. I have not found any other info about this on the web, so it seemed a worthy blog post.

Posted in Linux, SSL | Comments Off on SSL3_GET_SERVER_CERTIFICATE: certificate verify failed

nagios plugin check_snmp times out for certain ASNs

This is probably because you are missing some MIBS. Chances are this will fix it:


sudo apt-get install snmp-mibs-downloader

Posted in nagios | Comments Off on nagios plugin check_snmp times out for certain ASNs

Best Space Conquest Strategy Game

VGA PLanets has been re-done for the web.

best ever.

Posted in Uncategorized | Comments Off on Best Space Conquest Strategy Game

Password reset template not working in django — admin password reset comes up instead

This was a real head scratcher. Not sure exactly why but, of all the templates used by django-registration, this one template has an issue. But it does.

registration/password_reset_form.html

For some reason, the admin password reset form comes up instead of that one.

The solution is to define the TEMPLATE_DIRS variable in your settings.py file. Like this:

TEMPLATE_DIRS = (‘myapp/templates/’, ‘myapp/templates/registration/’)

Of course, substitute your template dirs.

Posted in django | Comments Off on Password reset template not working in django — admin password reset comes up instead

How to fix all sequences in postgres 9.x


-- select table_name || '_' || column_name || '_seq', reset_sequence(table_name, column_name, table_name || '_' || column_name || '_seq') from information_schema.columns where column_default like 'nextval%';
-- Function: reset_sequence(text, text)

-- DROP FUNCTION reset_sequence(text, text);

CREATE OR REPLACE FUNCTION reset_sequence(tablename text, columnname text)
RETURNS void AS
$BODY$
DECLARE
BEGIN
EXECUTE 'SELECT setval( pg_get_serial_sequence(''' || tablename || ''', ''' || columnname || '''),
(SELECT COALESCE(MAX(id)+1,1) FROM ' || tablename || '), false)';
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;

Posted in Linux, postgres | Comments Off on How to fix all sequences in postgres 9.x