Bug #5396 libmysqld shouldn't depend on SSL
Submitted: 3 Sep 2004 18:05 Modified: 14 Sep 2004 6:16
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:4.1.X (including 4.1.4-bk) OS:MacOS (Mac OS X)
Assigned to: Alexey Botchkov CPU Architecture:Any

[3 Sep 2004 18:05] Paul DuBois
Description:
I typically build with --with-vio and --with-openssl so that my MySQL client
libraries include OpenSSL support, and mysql_config --libs dutifully returns
a string that includes -lssl so that client programs link correctly.

mysql_config --libmysqld-libs does *not* include -lssl, because the
embedded server does not have a dependency on OpenSSL.

At least that used to be true.  I tried building an app today that
uses libmysqld and tried linking it against 4.1.4 and it failed with
a bunch of linker errors.  Commands below.  (The linker flags result
from using `mysql_config --libmysqld-libs` on the link command.)

gcc -c -I/usr/local/mysql/include/mysql embapp.c
gcc -o embapp embapp.o -L/usr/local/mysql/lib/mysql -lmysqld -lz -lm
ld: Undefined symbols:
_BN_bin2bn
_DH_free
_DH_new
_ERR_get_error_line_data
_ERR_print_errors_fp
_OPENSSL_add_all_algorithms_noconf
_SSL_CTX_check_private_key
_SSL_CTX_ctrl
_SSL_CTX_load_verify_locations
_SSL_CTX_new
_SSL_CTX_set_cipher_list
_SSL_CTX_set_default_verify_paths
_SSL_CTX_set_session_id_context
_SSL_CTX_set_verify
_SSL_CTX_use_PrivateKey_file
_SSL_CTX_use_certificate_file
_SSL_load_error_strings
_TLSv1_client_method
_TLSv1_server_method
_X509_NAME_oneline
_X509_STORE_CTX_get_current_cert
...

This does not occur for 4.0.x, and it does not occur for 4.1.0.  It
does occur for 4.1.1 through 4.1.4.  This is on Mac OS X.

Does libmysqld now have a dependency on OpenSSL if MySQL is built with
OpenSSL support?  If so, mysql_config --libmysqld-libs should produce
output that lists the SSL libs...

How to repeat:
See above.
[10 Sep 2004 13:15] Alexey Botchkov
Now embedded library can connect to the standalone server (contains libmysql's capabilities). So we just to add client libraries to embedded linker's line

bk commit - 4.1 tree (hf:1.2020) BUG#5396
[14 Sep 2004 6:16] Alexey Botchkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html