Skip to content

Commit 972ed88

Browse files
committedJul 25, 2023
Rename caCert to useCaCertificate.
1 parent 54fa2e0 commit 972ed88

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ To use a proxy for local testing -
7878
* proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
7979
* proxyUser: Username for connecting to proxy (Basic Auth Only)
8080
* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
81-
* caCert: Path to ca cert file, if required
81+
* useCaCertificate: Path to ca cert file, if required
8282

8383
```js
84-
bs_local_args = { 'key': '<browserstack-accesskey>', 'proxyHost': '127.0.0.1', 'proxyPort': '8000', 'proxyUser': 'user', 'proxyPass': 'password', 'caCert': '/Users/test/cert.pem' }
84+
bs_local_args = { 'key': '<browserstack-accesskey>', 'proxyHost': '127.0.0.1', 'proxyPort': '8000', 'proxyUser': 'user', 'proxyPass': 'password', 'useCaCertificate': '/Users/test/cert.pem' }
8585
```
8686

8787
#### Local Proxy

‎lib/Local.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ function Local(){
183183
}
184184
break;
185185

186-
case 'caCert':
186+
case 'useCaCertificate':
187187
if(value)
188-
this.caCert = value;
188+
this.useCaCertificate = value;
189189
break;
190190

191191
case 'proxyHost':
@@ -250,8 +250,8 @@ function Local(){
250250
conf.proxyHost = this.proxyHost;
251251
conf.proxyPort = this.proxyPort;
252252
}
253-
if (this.caCert) {
254-
conf.caCert = this.caCert;
253+
if (this.useCaCertificate) {
254+
conf.useCaCertificate = this.useCaCertificate;
255255
}
256256
if(!callback) {
257257
return this.binary.binaryPath(conf);
@@ -292,9 +292,9 @@ function Local(){
292292
}
293293
if(this.onlyAutomateFlag)
294294
args.push(this.onlyAutomateFlag);
295-
if (this.caCert) {
295+
if (this.useCaCertificate) {
296296
args.push('--use-ca-certificate');
297-
args.push(this.caCert);
297+
args.push(this.useCaCertificate);
298298
}
299299
if(this.proxyHost){
300300
args.push('--proxy-host');

‎lib/LocalBinary.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ function LocalBinary(){
7373
opts = [path.join(__dirname, 'download.js'), binaryPath, this.httpPath];
7474
if(conf.proxyHost && conf.proxyPort) {
7575
opts.push(conf.proxyHost, conf.proxyPort);
76-
if (conf.caCert) {
77-
opts.push(conf.caCert);
76+
if (conf.useCaCertificate) {
77+
opts.push(conf.useCaCertificate);
7878
}
79-
} else if (conf.caCert) {
80-
opts.push(undefined, undefined, conf.caCert);
79+
} else if (conf.useCaCertificate) {
80+
opts.push(undefined, undefined, conf.useCaCertificate);
8181
}
8282

8383
try{
@@ -118,9 +118,9 @@ function LocalBinary(){
118118
port: conf.proxyPort
119119
});
120120
}
121-
if (conf.caCert) {
121+
if (conf.useCaCertificate) {
122122
try {
123-
options.ca = fs.readFileSync(conf.caCert);
123+
options.ca = fs.readFileSync(conf.useCaCertificate);
124124
} catch(err) {
125125
console.log("failed to read cert file", err)
126126
}

‎lib/download.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const https = require('https'),
33
HttpsProxyAgent = require('https-proxy-agent'),
44
url = require('url');
55

6-
const binaryPath = process.argv[2], httpPath = process.argv[3], proxyHost = process.argv[4], proxyPort = process.argv[5], caCert = process.argv[6];
6+
const binaryPath = process.argv[2], httpPath = process.argv[3], proxyHost = process.argv[4], proxyPort = process.argv[5], useCaCertificate = process.argv[6];
77

88
var fileStream = fs.createWriteStream(binaryPath);
99

@@ -13,9 +13,9 @@ if(proxyHost && proxyPort) {
1313
host: proxyHost,
1414
port: proxyPort
1515
});
16-
if (caCert) {
16+
if (useCaCertificate) {
1717
try {
18-
options.ca = fs.readFileSync(caCert);
18+
options.ca = fs.readFileSync(useCaCertificate);
1919
} catch(err) {
2020
console.log("failed to read cert file", err)
2121
}

0 commit comments

Comments
 (0)
Please sign in to comment.