Fixed SSL_accept failing if the GWBUF with the initial MySQL auth packet contains some of the SSL authentication data.

This commit is contained in:
Markus Makela
2015-06-09 22:27:15 +03:00
parent 196d41cb88
commit de2910f75b
3 changed files with 150 additions and 1 deletions

View File

@ -490,7 +490,6 @@ static int gw_mysql_do_authentication(DCB *dcb, GWBUF *queue) {
/** Do the SSL Handshake */
if(ssl && protocol->owner_dcb->service->ssl_mode != SSL_DISABLED)
{
protocol->protocol_auth_state = MYSQL_AUTH_SSL_REQ;
if(do_ssl_accept(protocol) < 0)
@ -693,6 +692,11 @@ int gw_read_client_event(
{
rc = dcb_read_SSL(dcb, &read_buffer);
}
else if(dcb->service->ssl_mode != SSL_DISABLED &&
protocol->protocol_auth_state == MYSQL_AUTH_SENT)
{
rc = dcb_read_n(dcb, &read_buffer,(4 + 4 + 4 + 1 + 23));
}
else
{
rc = dcb_read(dcb, &read_buffer);