Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Fix import of zip project in case the archive is hosted on the same c…
Browse files Browse the repository at this point in the history
…luster which uses self-signed certificate (#672)

* Fix import of zip project in case the archive is hosted on the same cluster which uses self-signed certificate

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
Co-authored-by: Nick Boldt <nboldt@redhat.com>
  • Loading branch information
mmorhun and nickboldt committed Mar 23, 2020
1 parent 985d5df commit 919bd91
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/workspace-plugin/src/theia-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as fileuri from './file-uri';
import { execute } from './exec';
import * as git from './git';

const SS_CRT_PATH = '/tmp/che/secret/ca.crt';
const CHE_TASK_TYPE = 'che';

/**
Expand Down Expand Up @@ -203,8 +204,12 @@ export class TheiaImportZipCommand implements TheiaImportCommand {
const importZip = async (progress: theia.Progress<{ message?: string; increment?: number }>, token: theia.CancellationToken): Promise<void> => {
try {
// download
const wgetArgs = [this.locationURI!, '-O', this.zipfilePath];
await execute('wget', wgetArgs);
const curlArgs = ['-sSL', '--output', this.zipfilePath];
if (fs.existsSync(SS_CRT_PATH)) {
curlArgs.push('-k');
}
curlArgs.push(this.locationURI!);
await execute('curl', curlArgs);

// expand
fs.mkdirSync(this.projectDir);
Expand Down

0 comments on commit 919bd91

Please sign in to comment.