From: Iuri de Silvio Date: Sat, 14 May 2016 01:20:54 +0000 (-0400) Subject: Handle `SSL error: decryption failed or bad record mac` X-Git-Tag: rel_1_0_13~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06fd549df499c654817f325402c737bb69c74021;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Handle `SSL error: decryption failed or bad record mac` This is another psycopg2 error message representing an unusable connection. Fixes #3715 Change-Id: Ida6e212963e9c7336bf2944e7ef928619ac3a0e7 (cherry picked from commit 8ecad78ba3473d97df8ed4f20f28ddf966ce0277) Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/85 --- diff --git a/doc/build/changelog/changelog_10.rst b/doc/build/changelog/changelog_10.rst index e508e7b810..30f8fb73e0 100644 --- a/doc/build/changelog/changelog_10.rst +++ b/doc/build/changelog/changelog_10.rst @@ -18,6 +18,14 @@ .. changelog:: :version: 1.0.13 + .. change:: + :tags: bug, postgresql + :tickets: 3715 + + Added disconnect detection support for the error string + "SSL error: decryption failed or bad record mac". Pull + request courtesy Iuri de Silvio. + .. change:: :tags: bug, mssql :tickets: 3711 diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index a0f0cca754..0614081090 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -717,6 +717,7 @@ class PGDialect_psycopg2(PGDialect): 'connection has been closed unexpectedly', 'SSL SYSCALL error: Bad file descriptor', 'SSL SYSCALL error: EOF detected', + 'SSL error: decryption failed or bad record mac', ]: idx = str_e.find(msg) if idx >= 0 and '"' not in str_e[:idx]: