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 1
1
var common = require ( '../common' ) ;
2
+ var Crypto = require ( 'crypto' ) ;
2
3
var test = require ( 'utest' ) ;
3
4
var assert = require ( 'assert' ) ;
4
5
var ConnectionConfig = common . ConnectionConfig ;
@@ -168,13 +169,24 @@ test('ConnectionConfig#Constructor.ssl', {
168
169
assert . equal ( config . ssl , false ) ;
169
170
} ,
170
171
171
- 'string loads pre-defined profile' : function ( ) {
172
+ 'string "Amazon RDS" loads valid profile' : function ( ) {
172
173
var config = new ConnectionConfig ( {
173
174
ssl : 'Amazon RDS'
174
175
} ) ;
175
176
176
177
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
+ } ) ;
178
190
} ,
179
191
180
192
'throws on unknown profile name' : function ( ) {
You can’t perform that action at this time.
0 commit comments