Skip to content

Commit 341e5f4

Browse files
committed
MDEV-10054 Secure login fails when CIPHER is required
SSL: do not require client certificate to exist, if GRANT didn't require that
1 parent 8354c0c commit 341e5f4

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

mysql-test/r/ssl.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,3 +2172,8 @@ NULL
21722172
select 'still connected?';
21732173
still connected?
21742174
still connected?
2175+
create user mysqltest_1@localhost;
2176+
grant usage on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
2177+
Variable_name Value
2178+
Ssl_cipher EDH-RSA-DES-CBC3-SHA
2179+
drop user mysqltest_1@localhost;

mysql-test/t/ssl.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@ select 'still connected?';
3434
connection default;
3535
disconnect ssl_con;
3636

37+
create user mysqltest_1@localhost;
38+
grant usage on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
39+
--exec $MYSQL -umysqltest_1 --ssl-cipher=EDH-RSA-DES-CBC3-SHA -e "show status like 'ssl_cipher'" 2>&1
40+
drop user mysqltest_1@localhost;
41+
3742
# Wait till all disconnects are completed
3843
--source include/wait_until_count_sessions.inc

sql/sql_acl.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12199,6 +12199,9 @@ static bool acl_check_ssl(THD *thd, const ACL_USER *acl_user)
1219912199
return 1;
1220012200
}
1220112201
}
12202+
if (!acl_user->x509_issuer && !acl_user->x509_subject)
12203+
return 0; // all done
12204+
1220212205
/* Prepare certificate (if exists) */
1220312206
if (!(cert= SSL_get_peer_certificate(ssl)))
1220412207
return 1;

0 commit comments

Comments
 (0)