aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-09-13 22:26:54 +0000
committerrowanbeentje <rowan@beent.je>2010-09-13 22:26:54 +0000
commit92e7b9a652b0d1806d732079574aea7270b8a2c0 (patch)
tree4a05b6ecbbe2573fc53b8ac4c7de448282aaaea0 /Source/SPDatabaseDocument.m
parent0661135713d5c9b3a4e3e39e184ac3eb35926ac4 (diff)
downloadsequelpro-92e7b9a652b0d1806d732079574aea7270b8a2c0.tar.gz
sequelpro-92e7b9a652b0d1806d732079574aea7270b8a2c0.tar.bz2
sequelpro-92e7b9a652b0d1806d732079574aea7270b8a2c0.zip
- Implement support for MySQL over SSL for both TCP/IP and Socket connection modes.
- Upgrade the MySQL binaries to version 5.1.50 (was 5.1.46) - Enable SSL support in the MySQL libraries (this leads to a large increase in library size, unfortunately) - Enable more optimisations in the MySQL libraries (especially --enable-assembler for faster in-library string processing and --with-mysqld-ldflags=-all-static) This completes support for Issue #27.
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m35
1 files changed, 34 insertions, 1 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 648a7691..1a0ae6d6 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -267,10 +267,17 @@
[connectionController setHost:@""];
[connectionController setPort:@""];
[connectionController setSocket:@""];
+ [connectionController setUseSSL:NSOffState];
+ [connectionController setSslKeyFileLocationEnabled:NSOffState];
+ [connectionController setSslKeyFileLocation:nil];
+ [connectionController setSslCertificateFileLocationEnabled:NSOffState];
+ [connectionController setSslCertificateFileLocation:nil];
+ [connectionController setSslCACertFileLocationEnabled:NSOffState];
+ [connectionController setSslCACertFileLocation:nil];
[connectionController setSshHost:@""];
[connectionController setSshUser:@""];
[connectionController setSshKeyLocationEnabled:NSOffState];
- [connectionController setSshKeyLocation:@""];
+ [connectionController setSshKeyLocation:nil];
[connectionController setSshPort:@""];
[connectionController setDatabase:@""];
[connectionController setPassword:nil];
@@ -468,6 +475,22 @@
[connectionController setHost:[connection objectForKey:@"host"]];
if([connection objectForKey:@"port"])
[connectionController setPort:[NSString stringWithFormat:@"%ld", (long)[[connection objectForKey:@"port"] integerValue]]];
+
+ if([connection objectForKey:@"useSSL"])
+ [connectionController setUseSSL:[[connection objectForKey:@"useSSL"] intValue]];
+ if([connection objectForKey:@"sslKeyFileLocationEnabled"])
+ [connectionController setSslKeyFileLocationEnabled:[[connection objectForKey:@"sslKeyFileLocationEnabled"] intValue]];
+ if([connection objectForKey:@"sslKeyFileLocation"])
+ [connectionController setSslKeyFileLocation:[connection objectForKey:@"sslKeyFileLocation"]];
+ if([connection objectForKey:@"sslCertificateFileLocationEnabled"])
+ [connectionController setSslCertificateFileLocationEnabled:[[connection objectForKey:@"sslCertificateFileLocationEnabled"] intValue]];
+ if([connection objectForKey:@"sslCertificateFileLocation"])
+ [connectionController setSslCertificateFileLocation:[connection objectForKey:@"sslCertificateFileLocation"]];
+ if([connection objectForKey:@"sslCACertFileLocationEnabled"])
+ [connectionController setSslCACertFileLocationEnabled:[[connection objectForKey:@"sslCACertFileLocationEnabled"] intValue]];
+ if([connection objectForKey:@"sslCACertFileLocation"])
+ [connectionController setSslCACertFileLocation:[connection objectForKey:@"sslCACertFileLocation"]];
+
if([connection objectForKey:@"kcid"] && [(NSString *)[connection objectForKey:@"kcid"] length])
[self setKeychainID:[connection objectForKey:@"kcid"]];
@@ -530,6 +553,8 @@
[spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"auto_connect"];
+ [connectionController updateSSLInterface:self];
+
if([spf objectForKey:@"auto_connect"] && [[spf valueForKey:@"auto_connect"] boolValue]) {
[spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"];
[connectionController initiateConnection:self];
@@ -3292,6 +3317,14 @@
[connection setObject:[self host] forKey:@"host"];
[connection setObject:[self user] forKey:@"user"];
+ [connection setObject:[NSNumber numberWithInt:[connectionController useSSL]] forKey:@"useSSL"];
+ [connection setObject:[NSNumber numberWithInt:[connectionController sslKeyFileLocationEnabled]] forKey:@"sslKeyFileLocationEnabled"];
+ [connection setObject:[connectionController sslKeyFileLocation] forKey:@"sslKeyFileLocation"];
+ [connection setObject:[NSNumber numberWithInt:[connectionController sslCertificateFileLocationEnabled]] forKey:@"sslCertificateFileLocationEnabled"];
+ [connection setObject:[connectionController sslCertificateFileLocation] forKey:@"sslCertificateFileLocation"];
+ [connection setObject:[NSNumber numberWithInt:[connectionController sslCACertFileLocationEnabled]] forKey:@"sslCACertFileLocationEnabled"];
+ [connection setObject:[connectionController sslCACertFileLocation] forKey:@"sslCACertFileLocation"];
+
switch([connectionController type]) {
case SPTCPIPConnection:
aString = @"SPTCPIPConnection";