Blob Blame History Raw
mysql 5.5 does not export a HAVE_OPENSSL symbol, thus breaking MySQL-python's
rather-misguided-anyway conditional compilation for SSL support.  Since we
have no intention of ever shipping a non-SSL-enabled mysql in Fedora/RHEL,
we can just drop the conditionals, pending some other fix upstream.
(Since mysql_ssl_set is supposed to exist anyway, this might well be a
suitable fix for upstream too.)


diff -Naur MySQL-python-1.2.5.orig/_mysql.c MySQL-python-1.2.5/_mysql.c
--- MySQL-python-1.2.5.orig/_mysql.c	2014-01-02 13:52:50.000000000 +0100
+++ MySQL-python-1.2.5/_mysql.c	2015-10-15 17:14:08.495603713 +0200
@@ -551,10 +551,8 @@
 	MYSQL *conn = NULL;
 	PyObject *conv = NULL;
 	PyObject *ssl = NULL;
-#if HAVE_OPENSSL
 	char *key = NULL, *cert = NULL, *ca = NULL,
 		*capath = NULL, *cipher = NULL;
-#endif
 	char *host = NULL, *user = NULL, *passwd = NULL,
 		*db = NULL, *unix_socket = NULL;
 	unsigned int port = 0;
@@ -618,18 +616,12 @@
 #endif
 
 	if (ssl) {
-#if HAVE_OPENSSL
 		PyObject *value = NULL;
 		_stringsuck(ca, value, ssl);
 		_stringsuck(capath, value, ssl);
 		_stringsuck(cert, value, ssl);
 		_stringsuck(key, value, ssl);
 		_stringsuck(cipher, value, ssl);
-#else
-		PyErr_SetString(_mysql_NotSupportedError,
-				"client library does not have SSL support");
-		return -1;
-#endif
 	}
 
 	Py_BEGIN_ALLOW_THREADS ;
@@ -667,11 +659,9 @@
 	if (local_infile != -1)
 		mysql_options(&(self->connection), MYSQL_OPT_LOCAL_INFILE, (char *) &local_infile);
 
-#if HAVE_OPENSSL
 	if (ssl)
 		mysql_ssl_set(&(self->connection),
 			      key, cert, ca, capath, cipher);
-#endif
 
 	conn = mysql_real_connect(&(self->connection), host, user, passwd, db,
 				  port, unix_socket, client_flag);