@@ -16,8 +16,8 @@ describe('default configuration', function () {
1616 expect ( config . getDatabase ( ) ) . to . be . eql ( defaultSettings . sink [ 0 ] ) ;
1717 expect ( config . getTempPasswordConfig ( ) ) . to . be . eql ( defaultSettings . tempPassword ) ;
1818 expect ( config . getAuthorisedList ( ) ) . to . be . eql ( defaultSettings . authorisedList ) ;
19- expect ( config . getSSLKeyPath ( ) ) . to . be . eql ( "../../certs/ key.pem" ) ;
20- expect ( config . getSSLCertPath ( ) ) . to . be . eql ( "../../certs/ cert.pem" ) ;
19+ expect ( config . getTLSKeyPemPath ( ) ) . to . be . eql ( defaultSettings . tls . key ) ;
20+ expect ( config . getTLSCertPemPath ( ) ) . to . be . eql ( defaultSettings . tls . cert ) ;
2121 } ) ;
2222 after ( function ( ) {
2323 delete require . cache [ require . resolve ( '../src/config' ) ] ;
@@ -94,15 +94,17 @@ describe('user configuration', function () {
9494
9595 it ( 'should override default settings for SSL certificate' , function ( ) {
9696 const user = {
97- sslKeyPemPath : "my-key.pem" ,
98- sslCertPemPath : "my-cert.pem"
97+ tls : {
98+ key : 'my-key.pem' ,
99+ cert : 'my-cert.pem' ,
100+ } ,
99101 } ;
100102 fs . writeFileSync ( tempUserFile , JSON . stringify ( user ) ) ;
101103
102104 const config = require ( '../src/config' ) ;
103105
104- expect ( config . getSSLKeyPath ( ) ) . to . be . eql ( user . sslKeyPemPath ) ;
105- expect ( config . getSSLCertPath ( ) ) . to . be . eql ( user . sslCertPemPath ) ;
106+ expect ( config . getTLSKeyPemPath ( ) ) . to . be . eql ( user . tls . key ) ;
107+ expect ( config . getTLSCertPemPath ( ) ) . to . be . eql ( user . tls . cert ) ;
106108 } ) ;
107109
108110 afterEach ( function ( ) {
@@ -116,21 +118,14 @@ describe('validate config files', function () {
116118 const config = require ( '../src/config/file' ) ;
117119
118120 it ( 'all valid config files should pass validation' , function ( ) {
119- const validConfigFiles = [
120- 'proxy.config.valid-1.json' ,
121- 'proxy.config.valid-2.json' ,
122- ] ;
121+ const validConfigFiles = [ 'proxy.config.valid-1.json' , 'proxy.config.valid-2.json' ] ;
123122 for ( const testConfigFile of validConfigFiles ) {
124- expect ( config . validate ( path . join ( __dirname , fixtures , testConfigFile ) ) ) . to
125- . be . true ;
123+ expect ( config . validate ( path . join ( __dirname , fixtures , testConfigFile ) ) ) . to . be . true ;
126124 }
127125 } ) ;
128126
129127 it ( 'all invalid config files should fail validation' , function ( ) {
130- const invalidConfigFiles = [
131- 'proxy.config.invalid-1.json' ,
132- 'proxy.config.invalid-2.json' ,
133- ] ;
128+ const invalidConfigFiles = [ 'proxy.config.invalid-1.json' , 'proxy.config.invalid-2.json' ] ;
134129 for ( const testConfigFile of invalidConfigFiles ) {
135130 const test = function ( ) {
136131 config . validate ( path . join ( __dirname , fixtures , testConfigFile ) ) ;
0 commit comments