Skip to content

Commit eec3207

Browse files
authored
fix(npm-publish): Allows disabling of strict SSL checks (#2952)
1 parent 8a47a6d commit eec3207

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

utils/npm-publish/__tests__/npm-publish.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,23 @@ describe("npm-publish", () => {
187187
expect(runLifecycle).toHaveBeenCalledTimes(2);
188188
});
189189

190+
it.each([["true"], [true], ["false"], [false]])(
191+
"aliases strict-ssl to strictSSL",
192+
async (strictSSLValue) => {
193+
const opts = { "strict-ssl": strictSSLValue };
194+
195+
await npmPublish(pkg, tarFilePath, opts);
196+
197+
expect(publish).toHaveBeenCalledWith(
198+
expect.anything(),
199+
expect.anything(),
200+
expect.objectContaining({
201+
strictSSL: strictSSLValue,
202+
})
203+
);
204+
}
205+
);
206+
190207
it("calls publish lifecycles", async () => {
191208
const options = expect.objectContaining({
192209
projectScope: "@scope",

utils/npm-publish/npm-publish.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ function flattenOptions(obj) {
3030
// eslint-disable-next-line dot-notation -- (npm v7 compat)
3131
defaultTag: obj["tag"] || "latest",
3232
dryRun: obj["dry-run"],
33+
// libnpmpublish / npm-registry-fetch check strictSSL rather than strict-ssl
34+
strictSSL: obj["strict-ssl"],
3335
...obj,
3436
};
3537
}

0 commit comments

Comments
 (0)