Skip to content

Commit e23bb2a

Browse files
committed
RDBC-563 Improve validation on auth options for node.js - throw when certificate is not set
1 parent c02799f commit e23bb2a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Auth/Certificate.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ export abstract class Certificate implements ICertificate {
2727

2828
let certificate: ICertificate = null;
2929

30+
if (!options.certificate) {
31+
throwError("InvalidArgumentException", "Certificate cannot be null");
32+
}
33+
3034
switch (options.type) {
3135
case Certificate.PEM:
3236
certificate = this.createPem(options.certificate, options.password, options.ca);
3337
break;
3438
case Certificate.PFX:
39+
3540
certificate = this.createPfx(options.certificate, options.password, options.ca);
3641
break;
3742
default:

0 commit comments

Comments
 (0)