Skip to content

Commit 69f3287

Browse files
hsbtclaude
andcommitted
Handle Git's CA bundle for mswin the same way as for DevKit
A missing bundle now fails the setup, so it is reported there rather than as a certificate error later. The bundle is found on every runner image, windows-11-arm included. #971 (comment) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 08daae3 commit 69f3287

2 files changed

Lines changed: 16 additions & 24 deletions

File tree

‎dist/index.js‎

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

‎windows.js‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,8 @@ export async function install(platform, engine, version) {
5050
await downloadAndExtract(engine, version, url, base, rubyPrefix);
5151
}
5252

53-
// The OpenSSL in mswin builds looks for CA certificates in an OPENSSLDIR that does not exist on runners
54-
if (engine === 'mswin' && !process.env['SSL_CERT_FILE'] && !process.env['SSL_CERT_DIR']) {
55-
const certFile = findGitCertFile()
56-
if (certFile) {
57-
exportEnv({ SSL_CERT_FILE: certFile })
58-
} else {
59-
core.warning("Cannot find Git's cert file, set SSL_CERT_FILE to verify TLS certificates with mswin")
60-
}
53+
if (engine === 'mswin') {
54+
exportEnv({ SSL_CERT_FILE: findGitCertFile() })
6155
}
6256

6357
const paths = [`${rubyPrefix}\\bin`]
@@ -192,20 +186,22 @@ async function installMSYS2(url, rubyPrefix = process.env.RUNNER_TEMP) {
192186
return [`${msys2Path}\\${msys2Type}\\bin`, `${msys2Path}\\usr\\bin`]
193187
}
194188

189+
// DevKit and mswin Rubies have no usable CA certificates on runners, so they use the bundle of Git for Windows
195190
function findGitCertFile() {
196-
return [
191+
const certFile = [
197192
'C:\\Program Files\\Git\\ucrt64\\etc\\ssl\\cert.pem',
198193
'C:\\Program Files\\Git\\mingw64\\etc\\ssl\\cert.pem',
199194
'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem',
200195
'C:\\Program Files\\Git\\clangarm64\\etc\\ssl\\cert.pem',
201196
].find(file => fs.existsSync(file))
197+
if (certFile === undefined) {
198+
throw new Error("Cannot find Git's cert file")
199+
}
200+
return certFile
202201
}
203202

204203
async function installMSYS1(url) {
205204
const certFile = findGitCertFile()
206-
if (certFile === undefined) {
207-
throw new Error("Cannot find Git's cert file")
208-
}
209205

210206
const downloadPath = await common.measure('Downloading msys1 build tools', async () => {
211207
console.log(url)

0 commit comments

Comments
 (0)