You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
237 lines
9.4 KiB
237 lines
9.4 KiB
set @orig_sql_mode= @@sql_mode;
|
|
drop table if exists t1;
|
|
create table t1(f1 int);
|
|
insert into t1 values (5);
|
|
create user ssl_user1@localhost, ssl_user2@localhost,
|
|
ssl_user3@localhost, ssl_user4@localhost,
|
|
ssl_user5@localhost;
|
|
grant select on test.* to ssl_user1@localhost, ssl_user2@localhost,
|
|
ssl_user3@localhost, ssl_user4@localhost,
|
|
ssl_user5@localhost;
|
|
alter user ssl_user2@localhost require cipher "SSL_CIPHER";
|
|
alter user ssl_user3@localhost require cipher "SSL_CIPHER" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client";
|
|
alter user ssl_user4@localhost require cipher "SSL_CIPHER" AND SUBJECT "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=Client" ISSUER "/C=SE/ST=Stockholm/L=Stockholm/O=Oracle/OU=MySQL/CN=CA";
|
|
alter user ssl_user5@localhost require cipher "SSL_CIPHER" AND SUBJECT "xxx";
|
|
flush privileges;
|
|
connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET);
|
|
ERROR 28000: Access denied for user 'ssl_user5'@'localhost' (using password: NO)
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher SSL_CIPHER
|
|
select * from t1;
|
|
f1
|
|
5
|
|
delete from t1;
|
|
ERROR 42000: DELETE command denied to user 'ssl_user1'@'localhost' for table 't1'
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher SSL_CIPHER
|
|
select * from t1;
|
|
f1
|
|
5
|
|
delete from t1;
|
|
ERROR 42000: DELETE command denied to user 'ssl_user2'@'localhost' for table 't1'
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher SSL_CIPHER
|
|
select * from t1;
|
|
f1
|
|
5
|
|
delete from t1;
|
|
ERROR 42000: DELETE command denied to user 'ssl_user3'@'localhost' for table 't1'
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher SSL_CIPHER
|
|
select * from t1;
|
|
f1
|
|
5
|
|
delete from t1;
|
|
ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1'
|
|
drop user ssl_user1@localhost, ssl_user2@localhost,
|
|
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
|
|
drop table t1;
|
|
mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
|
|
mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
|
|
mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
|
|
WARNING: no verification of server certificate will be done. Use --ssl-mode=VERIFY_CA or VERIFY_IDENTITY.
|
|
mysqltest: [ERROR] SSL error: Unable to get private key from ''.
|
|
mysqltest: Could not open connection 'default': 2026 SSL connection error: Unable to get private key
|
|
WARNING: no verification of server certificate will be done. Use --ssl-mode=VERIFY_CA or VERIFY_IDENTITY.
|
|
mysqltest: [ERROR] SSL error: Unable to get certificate from ''.
|
|
mysqltest: Could not open connection 'default': 2026 SSL connection error: Unable to get certificate
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher DHE-RSA-AES256-SHA
|
|
WARNING: no verification of server certificate will be done. Use --ssl-mode=VERIFY_CA or VERIFY_IDENTITY.
|
|
Variable_name Value
|
|
Ssl_cipher SSL_CIPHER
|
|
End of 5.0 tests
|
|
DROP TABLE IF EXISTS thread_status;
|
|
DROP EVENT IF EXISTS event_status;
|
|
SELECT COUNT(*) = 1 FROM information_schema.processlist
|
|
WHERE user = 'event_scheduler' AND command = 'Daemon';
|
|
COUNT(*) = 1
|
|
1
|
|
CREATE EVENT event_status
|
|
ON SCHEDULE AT NOW()
|
|
ON COMPLETION NOT PRESERVE
|
|
DO
|
|
BEGIN
|
|
CREATE TABLE thread_status
|
|
SELECT variable_name, variable_value
|
|
FROM performance_schema.session_status
|
|
WHERE variable_name LIKE 'SSL_ACCEPTS' OR
|
|
variable_name LIKE 'SSL_CALLBACK_CACHE_HITS';
|
|
END$$
|
|
SELECT variable_name, variable_value FROM thread_status;
|
|
variable_name variable_value
|
|
Ssl_accepts #
|
|
Ssl_callback_cache_hits #
|
|
DROP TABLE thread_status;
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher AES128-SHA
|
|
WARNING: no verification of server certificate will be done. Use --ssl-mode=VERIFY_CA or VERIFY_IDENTITY.
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher AES128-SHA
|
|
WARNING: no verification of server certificate will be done. Use --ssl-mode=VERIFY_CA or VERIFY_IDENTITY.
|
|
mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
|
|
|
|
CREATE TABLE t1(a int);
|
|
INSERT INTO t1 VALUES (1), (2);
|
|
|
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
/*!50503 SET NAMES utf8mb4 */;
|
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|
DROP TABLE IF EXISTS `t1`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
LOCK TABLES `t1` WRITE;
|
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
|
INSERT INTO `t1` VALUES (1),(2);
|
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
|
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
|
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
/*!50503 SET NAMES utf8mb4 */;
|
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|
DROP TABLE IF EXISTS `t1`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
LOCK TABLES `t1` WRITE;
|
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
|
INSERT INTO `t1` VALUES (1),(2);
|
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
|
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
|
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
/*!50503 SET NAMES utf8mb4 */;
|
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|
DROP TABLE IF EXISTS `t1`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
LOCK TABLES `t1` WRITE;
|
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
|
INSERT INTO `t1` VALUES (1),(2);
|
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
|
UNLOCK TABLES;
|
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
|
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
mysqldump: [ERROR] SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.pem'.
|
|
mysqldump: Got error: 2026: SSL connection error: Unable to get private key when trying to connect
|
|
DROP TABLE t1;
|
|
Variable_name Value
|
|
Ssl_cipher DHE-RSA-AES256-SHA
|
|
Variable_name Value
|
|
Ssl_cipher DHE-RSA-AES128-SHA
|
|
Variable_name Value
|
|
Ssl_cipher AES256-SHA
|
|
Variable_name Value
|
|
Ssl_cipher DHE-RSA-AES128-SHA
|
|
select 'is still running; no cipher request crashed the server' as result from dual;
|
|
result
|
|
is still running; no cipher request crashed the server
|
|
CREATE USER bug42158@localhost REQUIRE X509;
|
|
GRANT SELECT ON test.* TO bug42158@localhost;
|
|
FLUSH PRIVILEGES;
|
|
SHOW STATUS LIKE 'Ssl_cipher';
|
|
Variable_name Value
|
|
Ssl_cipher SSL_CIPHER
|
|
DROP USER bug42158@localhost;
|
|
set sql_mode= @orig_sql_mode;
|
|
End of 5.1 tests
|
|
#
|
|
# Bug #20648276: SSL-RELATED GLOBAL STATUS INFORMATION ONLY AVAILABLE
|
|
# WHEN CONNECTED USING --SSL
|
|
#
|
|
# Must return empty
|
|
# Must return values for the certificate data
|
|
Variable_name Value
|
|
Ssl_server_not_after Dec 1 04:48:40 2029 GMT
|
|
Ssl_server_not_before Dec 5 04:48:40 2014 GMT
|
|
End of 5.7 tests
|
|
|