@@ -23,9 +23,8 @@ def self.instances
23
23
else
24
24
query = "SELECT MAX_USER_CONNECTIONS, MAX_CONNECTIONS, MAX_QUESTIONS, MAX_UPDATES, SSL_TYPE, SSL_CIPHER, X509_ISSUER, X509_SUBJECT, PASSWORD /*!50508 , PLUGIN */ FROM mysql.user WHERE CONCAT(user, '@', host) = '#{ name } '"
25
25
end
26
- @max_user_connections , @max_connections_per_hour , @max_queries_per_hour ,
27
- @max_updates_per_hour , ssl_type , ssl_cipher , x509_issuer , x509_subject ,
28
- @password , @plugin , @authentication_string = mysql_caller ( query , 'regular' ) . chomp . split ( %r{\t } )
26
+ @max_user_connections , @max_connections_per_hour , @max_queries_per_hour , @max_updates_per_hour , ssl_type , ssl_cipher ,
27
+ x509_issuer , x509_subject , @password , @plugin , @authentication_string = mysql_caller ( query , 'regular' ) . chomp . split ( %r{\t } )
29
28
@tls_options = parse_tls_options ( ssl_type , ssl_cipher , x509_issuer , x509_subject )
30
29
if newer_than ( 'mariadb' => '10.1.21' ) && ( @plugin == 'ed25519' || @plugin == 'mysql_native_password' )
31
30
# Some auth plugins (e.g. ed25519) use authentication_string
@@ -256,11 +255,12 @@ def tls_options=(array)
256
255
end
257
256
258
257
def self . parse_tls_options ( ssl_type , ssl_cipher , x509_issuer , x509_subject )
259
- if ssl_type == 'ANY'
258
+ case ssl_type
259
+ when 'ANY'
260
260
[ 'SSL' ]
261
- elsif ssl_type == 'X509'
261
+ when 'X509'
262
262
[ 'X509' ]
263
- elsif ssl_type == 'SPECIFIED'
263
+ when 'SPECIFIED'
264
264
options = [ ]
265
265
options << "CIPHER '#{ ssl_cipher } '" if !ssl_cipher . nil? && !ssl_cipher . empty?
266
266
options << "ISSUER '#{ x509_issuer } '" if !x509_issuer . nil? && !x509_issuer . empty?
0 commit comments