Skip to content

Commit

Permalink
fix: simplify ssl var naming
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-bechara committed Aug 3, 2021
1 parent 2d6cc11 commit 102c323
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ void AppModule.bootServer({
enable: true,
safe: ormConfig.NODE_ENV === AppEnvironment.PRODUCTION,
},
driverOptions: ormConfig.ORM_SSL_SERVER_CA
driverOptions: ormConfig.ORM_SERVER_CA
? {
connection: {
ssl: {
ca: Buffer.from(ormConfig.ORM_SSL_SERVER_CA, 'base64'),
cert: Buffer.from(ormConfig.ORM_SSL_CLIENT_CERTIFICATE, 'base64'),
key: Buffer.from(ormConfig.ORM_SSL_CLIENT_KEY, 'base64'),
ca: Buffer.from(ormConfig.ORM_SERVER_CA, 'base64'),
cert: Buffer.from(ormConfig.ORM_CLIENT_CERTIFICATE, 'base64'),
key: Buffer.from(ormConfig.ORM_CLIENT_KEY, 'base64'),
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions source/orm/orm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ export class OrmConfig {
@IsOptional()
@InjectSecret()
@IsBase64()
public readonly ORM_SSL_SERVER_CA: string;
public readonly ORM_SERVER_CA: string;

@IsOptional()
@InjectSecret()
@IsBase64()
public readonly ORM_SSL_CLIENT_CERTIFICATE: string;
public readonly ORM_CLIENT_CERTIFICATE: string;

@IsOptional()
@InjectSecret()
@IsBase64()
public readonly ORM_SSL_CLIENT_KEY: string;
public readonly ORM_CLIENT_KEY: string;

}
8 changes: 4 additions & 4 deletions source/test/test.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ void AppModule.bootServer({
enable: true,
safe: ormConfig.NODE_ENV === AppEnvironment.PRODUCTION,
},
driverOptions: ormConfig.ORM_SSL_SERVER_CA
driverOptions: ormConfig.ORM_SERVER_CA
? {
connection: {
ssl: {
ca: Buffer.from(ormConfig.ORM_SSL_SERVER_CA, 'base64'),
cert: Buffer.from(ormConfig.ORM_SSL_CLIENT_CERTIFICATE, 'base64'),
key: Buffer.from(ormConfig.ORM_SSL_CLIENT_KEY, 'base64'),
ca: Buffer.from(ormConfig.ORM_SERVER_CA, 'base64'),
cert: Buffer.from(ormConfig.ORM_CLIENT_CERTIFICATE, 'base64'),
key: Buffer.from(ormConfig.ORM_CLIENT_KEY, 'base64'),
},
},
}
Expand Down

0 comments on commit 102c323

Please sign in to comment.