Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8118153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:23:35+00:00 2026-06-06T04:23:35+00:00

I am trying to build mysql-5.0.33 client library with SSL support. For which I

  • 0

I am trying to build mysql-5.0.33 client library with SSL support. For which I am using

./configure --prefix=<some dir> --exec-prefix=<some dir> --with-openssl=<path to openssl dir> --without-server` 

to configure and then make and make install

Version of OpenSSL linked to is 1.0.0a. There is no problem or error in above process.

Now I have program as follows

#include <mysql.h>
#include <stdio.h>
int main() {
   MYSQL *conn;
   MYSQL_RES *res;
   MYSQL_ROW row;
   char *server = "192.168.1.62";
   char *user = "testssl";
   char *password = "testssl"; /* set me first */
   char *database = "mysql";
   int port = 3321;
   conn = mysql_init(NULL);
   mysql_ssl_set(conn, "client-key.pem", "client-cert.pem", "ca-cert.pem", NULL, "DHE-RSA-AES256-SHA");

   mysql_options(conn, MYSQL_OPT_CONNECT_TIMEOUT, "30");

   /* Connect to database */
   if (!mysql_real_connect(conn, server,
         user, password, database, port, NULL, 0)) {
      fprintf(stderr, "Real connect: %d: %s\n", mysql_errno(conn), mysql_error(conn));
      return 1;
   }

   printf("SSL cipher used: %s \n", mysql_get_ssl_cipher(conn));

   /* send SQL query */
   if (mysql_query(conn, "show tables;")) {
      fprintf(stderr, "\nQuery: %s\n", mysql_error(conn));
      return 1;
   }
   res = mysql_use_result(conn);
   /* output table name */
   printf("Results:\n");
   while ((row = mysql_fetch_row(res)) != NULL)
      printf("%s \n", row[0]);


   /* close connection */
   mysql_free_result(res);
   mysql_close(conn);
   return 0;
}

This program is build as follows :

gcc -o mysql-ssl-test -I <some dir>/include/mysql/ mysql-ssl-test.c -L <some dir>/lib/mysql/ -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl`

The mysql server (192.168.1.62) which i am connecting has ssl enabled and the User testssl can connect over ssl only (GRANT ... REQUIRE SSL). I have no problem connecting to the server using mysql command line or other mysql client line like Sqlyog.

Now i am getting error Real connect: 2026: SSL connection error, when i trying to run the program with this command LD_LIBRARY_PATH=<some dir>/lib/mysql/ ./mysql-ssl-test but it runs fine when tring to run with this command ./mysql-ssl-test (Here it trys to link with system libmysqlclient which is v5.5.25 and OpenSSL 1.0.0-fips)

Interestingly if i replace the line

mysql_ssl_set(conn, "client-key.pem", "client-cert.pem", "ca-cert.pem", NULL, "DHE-RSA-AES256-SHA");` 

with

mysql_ssl_set(conn, "client-key.pem", "client-cert.pem", "ca-cert.pem", NULL, NULL);` 

it runs fine even with LD_LIBRARY_PATH=<some dir>/lib/mysql/ ./mysql-ssl-test.

Is this a bug of mysql 5.0.33 or OpenSSL 1.0.0a that i have came across (googling for such bug was of no help) or I am doing some blunder while building libmysqlclient.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:23:36+00:00Added an answer on June 6, 2026 at 4:23 am

    Fixed : It was some kind of bug in MySQL 5.0.33. Fixed by upgrading to 5.0.86.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a system using Java and MySQL 5.1.63 GA where
i'm using ASP.NET + a MySql Db. I'm trying to configure a ListView so
Using MySQL and PHP; I'm trying to build an index that contains the averages
Im trying to build a feeds application in php in which im using a
I'm trying to build a widget for a client which would allow them to
I'm trying to build a query using php and mysql, $query = select *
Using PHP and MySQL, I have a forum system I'm trying to build. What
I'm trying to build out a mysql database design for a project. The problem
I'm trying build a method which returns the shortest path from one node to
I'm trying build an App Engine connected Android application and am having some problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.