1create procedure have_ssl()
2select if(variable_value > '','yes','no') as 'have_ssl'
3  from information_schema.session_status
4where variable_name='ssl_cipher';
5mysql --ssl-ca=cacert.pem -e "call test.have_ssl()"
6have_ssl
7no
8mysql --ssl -e "call test.have_ssl()"
9have_ssl
10no
11mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()"
12ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it
13mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()"
14ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it
15drop procedure have_ssl;
16