107a1 [Solved] MySQL compiled with SSL - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Ports & Packages > Installation and Maintenance of FreeBSD Ports or Packages

Installation and Maintenance of FreeBSD Ports or Packages Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Reply
 
Thread Tools Display Modes
  #1  
Old September 24th, 2009, 16:09
oobayly oobayly is offline
Junior Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 11
Thanked 0 Times in 0 Posts
Default MySQL compiled with SSL

I'm having some issues compiling MySQL with SSL support enabled.

Using:
7.2-RELEASE FreeBSD (GENERIC kernel)
mysql-server-5.1.39
mysql-client-5.1.39
openssl-0.9.8k_5

I've added the following /etc/make.conf
Code:
# Always compile MySQL with SSL, Optimized & Statically compiled
.if ${.CURDIR:M*/database/mysql*}
  WITH_OPENSSL=yes
  BUILD_OPTIMIZED=yes
  BUILD_STATIC=yes
.endif
However, when I use portupgrade to upgrade MySQL server & client, or build the ports using WITH_OPENSSL=yes they both report that they haven't been built with OpenSSL:

Code:
mysql> show variables like '%ssl%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_openssl  | NO    |
| have_ssl      | NO    |
| ssl_ca        |       |
| ssl_capath    |       |
| ssl_cert      |       |
| ssl_cipher    |       |
| ssl_key       |       |
+---------------+-------+
7 rows in set (0.00 sec)
Code:
# mysql --ssl-ca=cacert.pem
mysql: unknown variable 'ssl-ca=cacert.pem'
Reading the MySQL documentation at:
http://dev.mysql.com/doc/refman/5.1/...using-ssl.html
It says the following:
Quote:
Building MySQL using OpenSSL requires a shared OpenSSL library, otherwise linker errors occur.
However, I can't see any options for that when I look at the make options for openssl.

Any suggestions as to what I'm doing wrong.
Reply With Quote
  #2  
Old September 24th, 2009, 16:17
SirDice's Avatar
SirDice SirDice is online now
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,847
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

If I read this bit correctly:
Code:
.if defined(WITH_OPENSSL)
.if !defined(WITHOUT_YASSL)
CONFIGURE_ARGS+=--with-ssl=bundled
.else
USE_OPENSSL=	yes
CONFIGURE_ARGS+=--with-ssl=${OPENSSLBASE}
.endif
.endif
Using WITH_OPENSSL will build it with the bundled libraries. If you don't supply WITH_OPENSSL and openssl is already installed it will use the openssl libraries.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old September 24th, 2009, 16:44
oobayly oobayly is offline
Junior Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 11
Thanked 0 Times in 0 Posts
Default

Admittedly, my knowledge of Makefiles is pretty poor, but surely this bit (my indentation):
Code:
.if defined(WITH_OPENSSL)
	.if !defined(WITHOUT_YASSL)
		CONFIGURE_ARGS+=--with-ssl=bundled
	.else
		USE_OPENSSL=    yes
		CONFIGURE_ARGS+=--with-ssl=${OPENSSLBASE}
	.endif
.endif
means that the USE_OPENSSL and CONFIGURE_ARGS variables will only be set/appended to when the WITH_OPENSSL variable is set and the WITHOUT_YASSL is set?

Am just trying to compile with USE_OPENSSL=yes WITHOUT_YASSL=yes
Of course, I may just find that I'm wasting my time doing this
Reply With Quote
  #4  
Old September 24th, 2009, 21:30
SirDice's Avatar
SirDice SirDice is online now
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,847
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Quote:
Originally Posted by oobayly View Post
means that the USE_OPENSSL and CONFIGURE_ARGS variables will only be set/appended to when the WITH_OPENSSL variable is set and the WITHOUT_YASSL is set?

Am just trying to compile with USE_OPENSSL=yes WITHOUT_YASSL=yes
Of course, I may just find that I'm wasting my time doing this
Yeah, I think I read it a bit too quick. Don't use USE_OPENSSL though. Use WITH_OPENSSL and WITHOUT_YASSL.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #5  
Old September 29th, 2009, 17:56
oobayly oobayly is offline
Junior Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 11
Thanked 0 Times in 0 Posts
Default

Completely forgot to add a follow up.

Quote:
Don't use USE_OPENSSL though
Ah, the dangers of copying and pasting, I did mean WITH_OPENSSL, honest!

I compiled MySQL using WITH_OPENSSL=yes WITHOUT_YASSL=yes and it did the job perfectly.

Unfortunately, when I did a simple make, it didn't appear to use the variables set in /etc/make.conf
Code:
# Always compile MySQL with SSL, Optimized & Statically compiled
.if ${.CURDIR:M*/database/mysql*}
  WITH_OPENSSL=yes
  WITHOUT_YASSL=yes
  #BUILD_OPTIMIZED=yes
.endif
It's also not using the variables when I execute the following
Code:
portupgrade -f mysql-server
Reply With Quote
  #6  
Old September 29th, 2009, 18:02
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,929
Thanks: 30
Thanked 1,925 Times in 1,351 Posts
Default

Quote:
Code:
.if ${.CURDIR:M*/database/mysql*}
It's databases.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
The Following User Says Thank You to DutchDaemon For This Useful Post:
oobayly (September 29th, 2009)
  #7  
Old September 29th, 2009, 19:23
oobayly oobayly is offline
Junior Member
 
Join Date: Aug 2009
Posts: 56
Thanks: 11
Thanked 0 Times in 0 Posts
Default

Quote:
It's databases.
<Smacks head on desk> I'm going to take up gardening as a full time job.

Thanks.

Last edited by oobayly; September 29th, 2009 at 20:36. Reason: bad markup
Reply With Quote
Reply

Tags
7.2, mysql, openssl, ssl

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a SSL certificate dennylin93 Web & Network Services 5 May 13th, 2010 17:26
FreeNAS mysql problem - mysql.sock not found kalns Web & Network Services 10 September 25th, 2009 17:46
[Solved] SSL Credential Error? anthony911 Web & Network Services 3 September 2nd, 2009 18:41
Question about SSL anthony911 Web & Network Services 6 August 11th, 2009 22:02
pidgin, msn and ssl Roberth Installation and Maintenance of FreeBSD Ports or Packages 3 March 31st, 2009 08:14


All times are GMT +1. The time now is 11:35.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0