File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11var common = require ( '../common' ) ;
2+ var Crypto = require ( 'crypto' ) ;
23var test = require ( 'utest' ) ;
34var assert = require ( 'assert' ) ;
45var ConnectionConfig = common . ConnectionConfig ;
@@ -168,13 +169,24 @@ test('ConnectionConfig#Constructor.ssl', {
168169 assert . equal ( config . ssl , false ) ;
169170 } ,
170171
171- 'string loads pre-defined profile' : function ( ) {
172+ 'string "Amazon RDS" loads valid profile' : function ( ) {
172173 var config = new ConnectionConfig ( {
173174 ssl : 'Amazon RDS'
174175 } ) ;
175176
176177 assert . ok ( config . ssl ) ;
177- assert . ok ( / - - - - - B E G I N C E R T I F I C A T E - - - - - / . test ( config . ssl . ca ) ) ;
178+ assert . ok ( Array . isArray ( config . ssl . ca ) ) ;
179+
180+ config . ssl . ca . forEach ( function ( ca ) {
181+ assert . equal ( typeof ca , 'string' , 'ca is a string' ) ;
182+
183+ if ( Crypto . createPublicKey ) {
184+ var key = null ;
185+
186+ assert . doesNotThrow ( function ( ) { key = Crypto . createPublicKey ( ca ) ; } ) ;
187+ assert . equal ( key . type , 'public' ) ;
188+ }
189+ } ) ;
178190 } ,
179191
180192 'throws on unknown profile name' : function ( ) {
You can’t perform that action at this time.
0 commit comments