File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ var assert = require ( 'assert' ) ;
2
+ var common = require ( '../../common' ) ;
3
+ var connection = common . createConnection ( {
4
+ port : common . fakeServerPort ,
5
+ password : null ,
6
+ user : 'root'
7
+ } ) ;
8
+
9
+ var server = common . createFakeServer ( ) ;
10
+
11
+ server . listen ( common . fakeServerPort , function ( err ) {
12
+ assert . ifError ( err ) ;
13
+
14
+ connection . connect ( function ( err ) {
15
+ assert . ifError ( err ) ;
16
+ connection . destroy ( ) ;
17
+ server . destroy ( ) ;
18
+ } ) ;
19
+ } ) ;
20
+
21
+ server . on ( 'connection' , function ( incomingConnection ) {
22
+ incomingConnection . on ( 'clientAuthentication' , function ( packet ) {
23
+ if ( packet . scrambleBuff . length === 0 ) {
24
+ this . ok ( ) ;
25
+ } else {
26
+ this . deny ( ) ;
27
+ }
28
+ } ) ;
29
+
30
+ incomingConnection . handshake ( ) ;
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments