Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Nov 19, 2018 2:26 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: MySQL ConnectSSL
PostPosted: Tue Nov 15, 2011 1:55 pm 
Offline

Joined: Fri Jan 19, 2007 8:53 am
Posts: 8
Location: Underhill, VT
Hi all,

The MySQLCommunityServer class supports a "ConnectSSL" method with the following parameters:

MySQLCommunityServer.SSLConnect ( key as FolderItem, certificate as FolderItem, authority as FolderItem, authorityPath as FolderItem, cipher as String ) as Boolean


The online documentation says exactly zip about these parameters.

Other MySQL tools I have used (e.g., Sequel Pro on Mac) only ask me for the key, and connect just fine). I've tried omitting and NIL for the params other than "key," but the compiler doesn't like that.

Has anyone successfully used this method and can point me to some documentation?

Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: MySQL ConnectSSL
PostPosted: Wed Nov 16, 2011 3:50 pm 
Offline

Joined: Fri Jan 19, 2007 8:53 am
Posts: 8
Location: Underhill, VT
I worked out a different way to do this that does not depend on ConnectSSL.

I use a thread to run an async shell command that creates an SSH session for port 3306 into the remote MySQL server. As long as the thread is alive, the SSH is kept open. Then I can just use the normal Connect() call with host="127.0.0.1" and everything magically works.

The thread part in RB is not absolutely necessary; I could have opened a Terminal window and started the SSH session that way. But this way I don't need Terminal at all.

Of course, this assumes I'm not running a MySQL server on my local machine, but I'm not, so that's OK.


Top
 Profile  
Reply with quote  
 Post subject: Re: MySQL ConnectSSL
PostPosted: Wed Mar 28, 2012 9:22 am 
Offline
User avatar

Joined: Thu Aug 26, 2010 6:57 am
Posts: 569
Location: Sydney Australia
I would appreciate some examples or documentation also!

_________________
Regards

Chris Musty
http://www.specialised.net.au
-----------------------------------------------
if date.shortdate >= 4/6/2013 then
msgbox "I am using Xojo - YAY!!!"
else
msgbox "I am still using RS 12r2.1 - BOO!!!"
end if

Win 8 Pro, Ubuntu 13.04, Mint and Debian(gnome and KDE)
AWS for Hosting and TKL for AMI's


Top
 Profile  
Reply with quote  
 Post subject: Re: MySQL ConnectSSL
PostPosted: Fri Mar 30, 2012 3:55 pm 
Offline

Joined: Thu May 13, 2010 7:27 pm
Posts: 341
cweger wrote:
MySQLCommunityServer.SSLConnect ( key as FolderItem, certificate as FolderItem, authority as FolderItem, authorityPath as FolderItem, cipher as String ) as Boolean


  • key is the FolderItem containing the key file.
  • certificate is the FolderItem containing the certificate file.
  • authority is the FolderItem containing the certificate authority file.
  • authorityPath is a FolderItem where the trusted SSL CA certificates in pem format are located.
  • cipher is a String containing list of permissible ciphers to use for SSL encryption.

So to understand what you need to use that you have to look at how mySQL needs it:
http://dev.mysql.com/doc/refman/4.1/en/secure-using-ssl.html
So you'll need to create some certificates using OpenSSL.
Those certificates you'll apply to mySQL server. Those same certificates you'll use in the above code. So if it is true then continue, if it is false then bail.
Cipher is a string which your mySQL server will report.


Top
 Profile  
Reply with quote  
 Post subject: Re: MySQL ConnectSSL
PostPosted: Tue Dec 04, 2012 2:44 pm 
Offline
User avatar

Joined: Mon Nov 29, 2010 7:01 pm
Posts: 446
I also need help getting ConnectSSL to work

MySQLCommunityServer.ConnectSSL ( key as FolderItem, certificate as FolderItem, authority as FolderItem, authorityPath as FolderItem, cipher as String ) As Boolean


I have the following files:
ca-cert.pem
ca-key.pem
client-cert.pem
client-key.pem
client-req.pem
server-cert.pem
server-key.pem
server-req.pem

What goes where?
Can I drag these files into the application or do they need to be in a different folder?


Top
 Profile  
Reply with quote  
 Post subject: Re: MySQL ConnectSSL
PostPosted: Thu Dec 06, 2012 11:52 am 
Offline
User avatar

Joined: Mon Nov 29, 2010 7:01 pm
Posts: 446
This worked for me

db.ConnectSSL(GetFolderItem("client-key.pem"),GetFolderItem("client-cert.pem"),GetFolderItem("ca-cert.pem"), GetFolderItem(""),"AES256-SHA")

And then in the build automation I included the .pem files.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group