File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.0.22
2
+
3
+ - Check server supports SSL
4
+
1
5
## 0.0.21
2
6
3
7
- Fix _ lastError reset in _ forceClose() and used after
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class MySQLConnection {
32
32
final bool _secure;
33
33
final List <int > _incompleteBufferData = [];
34
34
Object ? _lastError;
35
+ int _serverCapabilities = 0 ;
35
36
36
37
MySQLConnection ._({
37
38
required Socket socket,
@@ -282,6 +283,14 @@ class MySQLConnection {
282
283
throw MySQLClientException ("Expected MySQLPacketInitialHandshake packet" );
283
284
}
284
285
286
+ _serverCapabilities = payload.capabilityFlags;
287
+
288
+ if (_secure && (_serverCapabilities & mysqlCapFlagClientSsl == 0 )) {
289
+ throw MySQLClientException (
290
+ "Server does not support SSL connection. Pass secure: false to createConnection or enable SSL support" ,
291
+ );
292
+ }
293
+
285
294
if (_secure) {
286
295
// it secure = true, initiate ssl connection
287
296
Future <void > initiateSSL () async {
You can’t perform that action at this time.
0 commit comments