Skip to content

Commit 2e235ac

Browse files
authored
The OpenSSL version has been changed to 3.4.2. (#493)
1 parent 7308337 commit 2e235ac

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

common-npm-packages/azure-arm-rest/azure-arm-common.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,12 +720,24 @@ export class ApplicationTokenCredentials {
720720
return deferred.promise;
721721
}
722722

723+
private _getOpenSSLPath() {
724+
if (tl.osType().match(/^Win/)) {
725+
if (tl.getPipelineFeature("UseOpenSSLv3.4.2InAzureArmRest")) {
726+
return tl.which(path.join(__dirname, 'openssl3.4.2', 'openssl'));
727+
} else {
728+
return tl.which(path.join(__dirname, 'openssl3.4.0', 'openssl'));
729+
}
730+
} else {
731+
return tl.which('openssl');
732+
}
733+
}
734+
723735
/**
724736
* @deprecated ADAL related methods are deprecated and will be removed.
725737
* Use Use `getMSALToken(force?: boolean)` instead.
726738
*/
727739
private _getSPNCertificateAuthorizationToken(): string {
728-
var openSSLPath = tl.osType().match(/^Win/) ? tl.which(path.join(__dirname, 'openssl', 'openssl')) : tl.which('openssl');
740+
var openSSLPath = this._getOpenSSLPath();
729741
var openSSLArgsArray = [
730742
"x509",
731743
"-sha1",
@@ -734,7 +746,7 @@ export class ApplicationTokenCredentials {
734746
this.certFilePath,
735747
"-fingerprint"
736748
];
737-
749+
tl.debug(`The OpenSSL version is ${tl.execSync(openSSLPath, 'version')}`);
738750
var pemExecutionResult = tl.execSync(openSSLPath, openSSLArgsArray);
739751
var additionalHeaders = {
740752
"alg": "RS256",
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1+
import * as tl from 'azure-pipelines-task-lib/task';
12
var path = require('path');
23
var util = require('../build-scripts/util');
3-
4+
var fs = require('fs');
45
var buildPath = './_build'
56

7+
var opensslLatestVersion = tl.getPipelineFeature('UseOpenSSLv3.4.2InAzureArmRest');
8+
var opensslDir;
9+
var opensslUrl;
10+
if (opensslLatestVersion) {
11+
opensslDir = 'openssl3.4.2';
12+
opensslUrl = 'https://vstsagenttools.blob.core.windows.net/tools/openssl/3.4.2/M262/openssl.zip';
13+
}
14+
else {
15+
opensslDir = 'openssl3.4.0';
16+
opensslUrl = 'https://vstsagenttools.blob.core.windows.net/tools/openssl/3.4.0/M252/openssl.zip';
17+
}
18+
19+
if (!fs.existsSync(path.join(__dirname, opensslDir))) {
20+
util.run(`node ../build-scripts/downloadArchive.js ${opensslUrl} ${opensslDir}`);
21+
}
622
util.rm('-rf', buildPath)
723
util.run(path.join(__dirname, 'node_modules/.bin/tsc') + ' --outDir ' + buildPath);
824

@@ -11,6 +27,6 @@ util.cp(path.join(__dirname, 'package-lock.json'), buildPath);
1127
util.cp(path.join(__dirname, 'module.json'), buildPath);
1228
util.cp(path.join('./Tests', 'package.json'), path.join(buildPath, 'Tests'));
1329
util.cp(path.join('./Tests', 'package-lock.json'), path.join(buildPath, 'Tests'));
14-
util.cp('-r', 'openssl', buildPath);
30+
util.cp('-r', opensslDir, buildPath);
1531
util.cp('-r', 'Strings', buildPath);
1632
util.cp('-r', 'node_modules', buildPath);

common-npm-packages/azure-arm-rest/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common-npm-packages/azure-arm-rest/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azure-pipelines-tasks-azure-arm-rest",
3-
"version": "3.262.1",
3+
"version": "3.263.0",
44
"description": "Common Lib for Azure ARM REST apis",
55
"repository": {
66
"type": "git",
@@ -38,6 +38,6 @@
3838
"typescript": "^4.9.5"
3939
},
4040
"scripts": {
41-
"build": "node ../build-scripts/downloadArchive.js https://vstsagenttools.blob.core.windows.net/tools/openssl/3.4.0/M252/openssl.zip ./openssl && node make.js"
41+
"build": "node make.js"
4242
}
4343
}

0 commit comments

Comments
 (0)