summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <gluh@gluh.(none)>2002-11-05 12:05:58 +0400
committerunknown <gluh@gluh.(none)>2002-11-05 12:05:58 +0400
commit69a5dd196cc89c690b3531b75bb77f9c4a048b50 (patch)
treee27e1d7b216164535ab3100467fa0dea7d08a146 /libmysql
parentf6b9a33fb67c9143bda91e2fbdef6272c6d2e209 (diff)
downloadmariadb-git-69a5dd196cc89c690b3531b75bb77f9c4a048b50.tar.gz
Error code for ssl connection
Fix bug when server hang(with SSL, with modified libmysql) Add options master-ssl-capath and master-ssl-cipher Add some error checking(SSL) include/errmsg.h: Error code for SSL connection include/violite.h: Change return value in sslaccept Remove unused variable open_ libmysql/errmsg.c: Add client side descriptive message when ssl handshake fail libmysql/libmysql.c: Add ssl error code Add proper error checking sql/mysqld.cc: Add options master-ssl-capath and master-ssl-cipher sql/sql_parse.cc: Add error checking after sslaccept vio/viossl.c: Add ssl handshake error cheking vio/viosslfactories.c: Change error description when using wrong key or certificate
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/errmsg.c9
-rw-r--r--libmysql/libmysql.c13
2 files changed, 14 insertions, 8 deletions
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 3fdb9c0ddc6..47d19281a04 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -49,7 +49,8 @@ const char *client_errors[]=
"Error on SHOW SLAVE STATUS:",
"Error on SHOW SLAVE HOSTS:",
"Error connecting to slave:",
- "Error connecting to master:"
+ "Error connecting to master:",
+ "SSL connection error"
};
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
@@ -82,7 +83,8 @@ const char *client_errors[]=
"Error on SHOW SLAVE STATUS:",
"Error on SHOW SLAVE HOSTS:",
"Error connecting to slave:",
- "Error connecting to master:"
+ "Error connecting to master:",
+ "SSL connection error"
};
#else /* ENGLISH */
@@ -113,7 +115,8 @@ const char *client_errors[]=
"Error on SHOW SLAVE STATUS:",
"Error on SHOW SLAVE HOSTS:",
"Error connecting to slave:",
- "Error connecting to master:"
+ "Error connecting to master:",
+ "SSL connection error"
};
#endif
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index c1d8dd6283f..c9fb2f84a3c 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1872,15 +1872,18 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
options->ssl_capath,
options->ssl_cipher)))
{
- /* TODO: Change to SSL error */
- net->last_errno= CR_SERVER_LOST;
+ net->last_errno= CR_SSL_CONNECTION_ERROR;
strmov(net->last_error,ER(net->last_errno));
goto error;
}
DBUG_PRINT("info", ("IO layer change in progress..."));
- /* TODO: Add proper error checking here, with return error message */
- sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd),
- mysql->net.vio, (long) (mysql->options.connect_timeout));
+ if(sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd),
+ mysql->net.vio, (long) (mysql->options.connect_timeout)))
+ {
+ net->last_errno= CR_SSL_CONNECTION_ERROR;
+ strmov(net->last_error,ER(net->last_errno));
+ goto error;
+ }
DBUG_PRINT("info", ("IO layer change done!"));
}
#endif /* HAVE_OPENSSL */