From 4ad26db45b46d8267fcb5203571b81bc8949b853 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 03:01:19 +0100 Subject: Reformatting code for modern ObjC Replaced all [NSNumber numberWithBool:YES/NO] with the @YES/@NO literals. Also replaced some TRUE/FALSE with their YES/NO counterparts. --- .../Source/SPMySQLConnection Categories/Delegate & Proxy.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m index 85b2db9b..be6d054b 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m @@ -111,7 +111,7 @@ // Trigger a reconnect depending on connection usage recently. If the connection has // actively been used in the last couple of minutes, trigger a full reconnection attempt. if (_elapsedSecondsSinceAbsoluteTime(lastConnectionUsedTime) < 60 * 2) { - reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:[NSNumber numberWithBool:YES]] autorelease]; + reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:@YES] autorelease]; [reconnectionThread setName:@"SPMySQL reconnection thread (full)"]; [reconnectionThread start]; -- cgit v1.2.3 From 994057ae2a82dc110a385ced4239ce49cc0601f8 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 17:20:18 +0100 Subject: Add cast for [NSApp delegate] * (Also changed some outdated URLs) * Replaced [NSApplication sharedApplication] with NSApp --- Frameworks/SPMySQLFramework/build-mysql-client.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/build-mysql-client.sh b/Frameworks/SPMySQLFramework/build-mysql-client.sh index 5fd1accb..2e7c4fc9 100755 --- a/Frameworks/SPMySQLFramework/build-mysql-client.sh +++ b/Frameworks/SPMySQLFramework/build-mysql-client.sh @@ -30,7 +30,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # -# More info at +# More info at # Builds the MySQL client libraries for distrubution in Sequel Pro's MySQL framework. # -- cgit v1.2.3 From 3b251b8e3d4dc9a694ef76562b388ab07da54785 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 13 Dec 2014 19:48:41 +0100 Subject: Replace some NSDictionaries with literals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [NSDictionary dictionary] → @{} * [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past. * Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist). --- .../SPMySQLFramework/Source/SPMySQLConnection.m | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m index 79d5060a..0d9d16ff 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m @@ -377,20 +377,20 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS { NSFileManager *fileManager = [NSFileManager defaultManager]; - NSArray *possibleSocketLocations = [NSArray arrayWithObjects: - @"/tmp/mysql.sock", // Default - @"/Applications/MAMP/tmp/mysql/mysql.sock", // MAMP default location - @"/Applications/xampp/xamppfiles/var/mysql/mysql.sock", // XAMPP default location - @"/var/mysql/mysql.sock", // Mac OS X Server default - @"/opt/local/var/run/mysqld/mysqld.sock", // Darwinports MySQL - @"/opt/local/var/run/mysql4/mysqld.sock", // Darwinports MySQL 4 - @"/opt/local/var/run/mysql5/mysqld.sock", // Darwinports MySQL 5 - @"/usr/local/zend/mysql/tmp/mysql.sock", // Zend Server CE (see Issue #1251) - @"/var/run/mysqld/mysqld.sock", // As used on Debian/Gentoo - @"/var/tmp/mysql.sock", // As used on FreeBSD - @"/var/lib/mysql/mysql.sock", // As used by Fedora - @"/opt/local/lib/mysql/mysql.sock", // Alternate fedora - nil]; + NSArray *possibleSocketLocations = @[ + @"/tmp/mysql.sock", // Default + @"/Applications/MAMP/tmp/mysql/mysql.sock", // MAMP default location + @"/Applications/xampp/xamppfiles/var/mysql/mysql.sock", // XAMPP default location + @"/var/mysql/mysql.sock", // Mac OS X Server default + @"/opt/local/var/run/mysqld/mysqld.sock", // Darwinports MySQL + @"/opt/local/var/run/mysql4/mysqld.sock", // Darwinports MySQL 4 + @"/opt/local/var/run/mysql5/mysqld.sock", // Darwinports MySQL 5 + @"/usr/local/zend/mysql/tmp/mysql.sock", // Zend Server CE (see Issue #1251) + @"/var/run/mysqld/mysqld.sock", // As used on Debian/Gentoo + @"/var/tmp/mysql.sock", // As used on FreeBSD + @"/var/lib/mysql/mysql.sock", // As used by Fedora + @"/opt/local/lib/mysql/mysql.sock" + ]; for (NSUInteger i = 0; i < [possibleSocketLocations count]; i++) { if ([fileManager fileExistsAtPath:[possibleSocketLocations objectAtIndex:i]]) -- cgit v1.2.3 From b00142a846ceda985516a0bdec3c1d6a9f47bdee Mon Sep 17 00:00:00 2001 From: "teng.liu" Date: Sun, 8 Feb 2015 18:18:35 +0800 Subject: fallback solution for NSString decode error --- .../Source/SPMySQLResult Categories/Data Conversion.m | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m index 357eb53f..0ed8a51e 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m @@ -239,6 +239,17 @@ static inline NSString * _bitStringWithBytes(const char *bytes, NSUInteger lengt return returnString; } +static inline NSString * _convertStringDataSafely(const void *dataBytes, NSUInteger dataLength, NSStringEncoding aStringEncoding) +{ + NSString * result = [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + + if (result == nil) { + return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:NSASCIIStringEncoding] autorelease]; + } + + return result; +} + /** * Converts stored string data - which may contain nul bytes - to a native * Objective-C string, using the current class encoding. @@ -247,9 +258,9 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da { // Fast case - if not using a preview length, or if the data length is shorter, return the requested data. - if (previewLength == NSNotFound || dataLength <= previewLength) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; - } + if (previewLength == NSNotFound || dataLength <= previewLength) { + return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); + } NSUInteger i = 0, characterLength = 0, byteLength = previewLength; uint16_t continuationStart, continuationEnd; @@ -394,7 +405,7 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da // If returning the full string, use a fast path if (byteLength >= dataLength) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); } // Get a string using the calculated details -- cgit v1.2.3 From b75d0c396376e0d82eabdfe971436ec1b97a61cf Mon Sep 17 00:00:00 2001 From: "teng.liu" Date: Mon, 16 Feb 2015 17:39:28 +0800 Subject: move the string method to SPMySQLStringAdditions --- .../Source/SPMySQLResult Categories/Data Conversion.m | 15 ++------------- .../SPMySQLFramework/Source/SPMySQLStringAdditions.h | 1 + .../SPMySQLFramework/Source/SPMySQLStringAdditions.m | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m index 0ed8a51e..639ff0b9 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLResult Categories/Data Conversion.m @@ -239,17 +239,6 @@ static inline NSString * _bitStringWithBytes(const char *bytes, NSUInteger lengt return returnString; } -static inline NSString * _convertStringDataSafely(const void *dataBytes, NSUInteger dataLength, NSStringEncoding aStringEncoding) -{ - NSString * result = [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; - - if (result == nil) { - return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:NSASCIIStringEncoding] autorelease]; - } - - return result; -} - /** * Converts stored string data - which may contain nul bytes - to a native * Objective-C string, using the current class encoding. @@ -259,7 +248,7 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da // Fast case - if not using a preview length, or if the data length is shorter, return the requested data. if (previewLength == NSNotFound || dataLength <= previewLength) { - return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); + return [NSString stringForDataBytes:dataBytes length:dataLength encoding:aStringEncoding]; } NSUInteger i = 0, characterLength = 0, byteLength = previewLength; @@ -405,7 +394,7 @@ static inline NSString * _convertStringData(const void *dataBytes, NSUInteger da // If returning the full string, use a fast path if (byteLength >= dataLength) { - return _convertStringDataSafely(dataBytes, dataLength, aStringEncoding); + return [NSString stringForDataBytes:dataBytes length:dataLength encoding:aStringEncoding]; } // Get a string using the calculated details diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h index bb29c02b..60832c53 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.h @@ -33,5 +33,6 @@ - (NSString *)mySQLBacktickQuotedString; - (NSString *)mySQLTickQuotedString; ++ (NSString *)stringForDataBytes:(const void *)dataBytes length:(NSUInteger)dataLength encoding:(NSStringEncoding)aStringEncoding; @end diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m index 39688ea8..f987c98b 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStringAdditions.m @@ -52,4 +52,18 @@ return [NSString stringWithFormat: @"'%@'", [self stringByReplacingOccurrencesOfString:@"'" withString:@"''"]]; } +/** + * Returns the string for the bytes according to the encoding, decode in ASCII if failed + */ ++ (NSString *) stringForDataBytes:(const void *)dataBytes length:(NSUInteger)dataLength encoding:(NSStringEncoding)aStringEncoding +{ + NSString * string = [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:aStringEncoding] autorelease]; + + if (string == nil) { + return [[[NSString alloc] initWithBytes:dataBytes length:dataLength encoding:NSASCIIStringEncoding] autorelease]; + } + + return string; +} + @end -- cgit v1.2.3 From ed38f229a052a678d3a5022afd3806b1c3b434cf Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 4 Mar 2015 01:44:12 +0100 Subject: !!! Update mysql client libs to 5.5.42 This enables SHA256 client certificates (issue #2071) and disables SSL2 and SSL3 connections. Please test carefully! --- .../MySQL Client Libraries/include/mysql_version.h | 11 ++++++----- .../MySQL Client Libraries/lib/libmysqlclient.a | Bin 7884800 -> 7917176 bytes 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h b/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h index 350e9f1c..7a8578ad 100644 --- a/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h +++ b/Frameworks/SPMySQLFramework/MySQL Client Libraries/include/mysql_version.h @@ -1,6 +1,7 @@ -/* Copyright (c) 1996, 1999-2004, 2007 MySQL AB - Use is subject to license terms - This file is public domain and comes with NO WARRANTY of any kind */ +/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB + & Detron HB, 1996, 1999-2004, 2007 MySQL AB. + This file is public domain and comes with NO WARRANTY of any kind +*/ /* Version numbers for protocol & mysqld */ @@ -10,11 +11,11 @@ #include #else #define PROTOCOL_VERSION 10 -#define MYSQL_SERVER_VERSION "5.5.33" +#define MYSQL_SERVER_VERSION "5.5.42" #define MYSQL_BASE_VERSION "mysqld-5.5" #define MYSQL_SERVER_SUFFIX_DEF "" #define FRM_VER 6 -#define MYSQL_VERSION_ID 50533 +#define MYSQL_VERSION_ID 50542 #define MYSQL_PORT 3306 #define MYSQL_PORT_DEFAULT 0 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" diff --git a/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a b/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a index aad3f2a3..aa0d6109 100644 Binary files a/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a and b/Frameworks/SPMySQLFramework/MySQL Client Libraries/lib/libmysqlclient.a differ -- cgit v1.2.3 From 784876380b871b6d85978a705e2477e7b7d2d984 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 9 Mar 2015 00:00:43 +0100 Subject: Minimal refactoring Replaced some (range.location + range.length) with NSMaxRange(range) --- Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m index 447cf19b..86a6b2b5 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLStreamingResultStore.m @@ -630,8 +630,8 @@ static inline void SPMySQLStreamingResultStoreFreeRowData(SPMySQLStreamingResult { // Throw an exception if the range is out of bounds - if (rangeToRemove.location + rangeToRemove.length > numberOfRows) { - [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(rangeToRemove.location + rangeToRemove.length), (unsigned long long)numberOfRows]; + if (NSMaxRange(rangeToRemove) > numberOfRows) { + [NSException raise:NSRangeException format:@"Requested storage index (%llu) beyond bounds (%llu)", (unsigned long long)(NSMaxRange(rangeToRemove)), (unsigned long long)numberOfRows]; } // Lock the data mutex @@ -639,14 +639,14 @@ static inline void SPMySQLStreamingResultStoreFreeRowData(SPMySQLStreamingResult // Free rows in the range NSUInteger i; - for (i = rangeToRemove.location; i < rangeToRemove.location + rangeToRemove.length; i++) { + for (i = rangeToRemove.location; i < NSMaxRange(rangeToRemove); i++) { SPMySQLStreamingResultStoreFreeRowData(dataStorage[i]); } numberOfRows -= rangeToRemove.length; // Renumber all subsequent indices to fill the gap size_t pointerSize = sizeof(SPMySQLStreamingResultStoreRowData *); - memmove(dataStorage + rangeToRemove.location, dataStorage + rangeToRemove.location + rangeToRemove.length, (numberOfRows - rangeToRemove.location) * pointerSize); + memmove(dataStorage + rangeToRemove.location, dataStorage + NSMaxRange(rangeToRemove), (numberOfRows - rangeToRemove.location) * pointerSize); // Unlock the mutex pthread_mutex_unlock(&dataLock); -- cgit v1.2.3 From 9f2e5a6b0fafeec8f94dfa00414b0016b12194ba Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 17 Mar 2015 01:37:41 +0100 Subject: Allow selection of SSH client binary in prefs Hey, I was against this, but if you want it... - just don't blame me for what might happen :shipit: --- Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h index a6f84567..3622b312 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnectionProxy.h @@ -33,11 +33,12 @@ * Connection proxy state constants. */ typedef enum { - SPMySQLProxyIdle = 0, - SPMySQLProxyConnecting = 1, - SPMySQLProxyWaitingForAuth = 2, - SPMySQLProxyConnected = 3, - SPMySQLProxyForwardingFailed = 4 + SPMySQLProxyIdle = 0, + SPMySQLProxyConnecting = 1, + SPMySQLProxyWaitingForAuth = 2, + SPMySQLProxyConnected = 3, + SPMySQLProxyForwardingFailed = 4, + SPMySQLProxyLaunchFailed = 5 } SPMySQLConnectionProxyState; -- cgit v1.2.3 From 6b32b225106245755e9fe4543e9eb4883cbb9c2b Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 21 Mar 2015 00:04:02 +0100 Subject: Allow to set SSL cipher list in SPMySQL --- .../Source/SPMySQLConnection Categories/Copying.m | 1 + Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h | 10 ++++++++++ Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m | 9 ++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m index 022708b8..32efa375 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Copying.m @@ -54,6 +54,7 @@ [copy setSocketPath:socketPath]; [copy setUseSSL:useSSL]; [copy setSslKeyFilePath:sslKeyFilePath]; + [copy setSslCipherList:sslCipherList]; [copy setSslCertificatePath:sslCertificatePath]; [copy setSslCACertificatePath:sslCACertificatePath]; [copy setTimeout:timeout]; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h index 34b21043..1720fcf6 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h @@ -51,6 +51,7 @@ NSString *sslKeyFilePath; NSString *sslCertificatePath; NSString *sslCACertificatePath; + NSString *sslCipherList; // MySQL connection details and state struct st_mysql *mySQLConnection; @@ -143,6 +144,15 @@ @property (readwrite, retain) NSString *sslCertificatePath; @property (readwrite, retain) NSString *sslCACertificatePath; +/** + * List of supported ciphers for SSL/TLS connections. + * This is a colon-separated string of names as used by + * `openssl ciphers`. The order of entries specifies + * their preference (earlier = better). + * A value of nil (default) means SPMySQL will use its built-in cipher list. + */ +@property (readwrite, retain) NSString *sslCipherList; + @property (readwrite, assign) NSUInteger timeout; @property (readwrite, assign) BOOL useKeepAlive; @property (readwrite, assign) CGFloat keepAliveInterval; diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m index 0d9d16ff..9fa5a9c8 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m @@ -65,6 +65,7 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS @synthesize sslKeyFilePath; @synthesize sslCertificatePath; @synthesize sslCACertificatePath; +@synthesize sslCipherList; @synthesize timeout; @synthesize useKeepAlive; @synthesize keepAliveInterval; @@ -217,6 +218,8 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS [proxy setConnectionStateChangeSelector:NULL delegate:nil]; [proxy release]; } + + [self setSslCipherList:nil]; // Ensure the query lock is unlocked, thereafter setting to nil in case of pending calls if ([connectionLock condition] != SPMySQLConnectionIdle) { @@ -546,6 +549,7 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS const char *theSSLKeyFilePath = NULL; const char *theSSLCertificatePath = NULL; const char *theCACertificatePath = NULL; + const char *theSSLCiphers = SPMySQLSSLPermissibleCiphers; if (sslKeyFilePath) { theSSLKeyFilePath = [[sslKeyFilePath stringByExpandingTildeInPath] UTF8String]; @@ -556,8 +560,11 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS if (sslCACertificatePath) { theCACertificatePath = [[sslCACertificatePath stringByExpandingTildeInPath] UTF8String]; } + if(sslCipherList) { + theSSLCiphers = [sslCipherList UTF8String]; + } - mysql_ssl_set(theConnection, theSSLKeyFilePath, theSSLCertificatePath, theCACertificatePath, NULL, SPMySQLSSLPermissibleCiphers); + mysql_ssl_set(theConnection, theSSLKeyFilePath, theSSLCertificatePath, theCACertificatePath, NULL, theSSLCiphers); } MYSQL *connectionStatus = mysql_real_connect(theConnection, theHost, theUsername, thePassword, NULL, (unsigned int)port, theSocket, SPMySQLConnectionOptions); -- cgit v1.2.3