Skip to content

Commit

Permalink
tools: use idf-env to refresh root certificates (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgik authored Sep 1, 2021
1 parent 39214a0 commit 83757c6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Build-Installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function PrepareIdf7za {
function PrepareIdfEnv {
PrepareIdfFile -BasePath build\$InstallerType\lib `
-FilePath idf-env.exe `
-DownloadUrl https://github.com/espressif/idf-env/releases/download/v1.2.1.0/win64.idf-env.exe
-DownloadUrl https://github.com/espressif/idf-env/releases/download/v1.2.2.0/win64.idf-env.exe
}

function PrepareIdfGit {
Expand Down
2 changes: 1 addition & 1 deletion src/InnoSetup/IdfToolsSetup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <idp.iss>

#define MyAppName "ESP-IDF Tools"
#define MyAppVersion "2.10"
#define MyAppVersion "2.11"
#define MyAppPublisher "Espressif Systems (Shanghai) Co. Ltd."
#define MyAppURL "https://github.com/espressif/esp-idf"

Expand Down
26 changes: 20 additions & 6 deletions src/InnoSetup/Pages/SystemCheckPage.iss
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,29 @@ var
begin
SystemLogTitle(CustomMessage('SystemCheckRootCertificates') + ' ');
{ It's necessary to invoke PowerShell *BEFORE* Python. Invoke-Request will retrieve and add Root Certificate if necessary. }
{ It's necessary to invoke reuqest to https server *BEFORE* Python. idf-env will retrieve and add Root Certificate if necessary. }
{ Without the certificate Python is failing to connect to https. }
{ Windows command to list current certificates: certlm.msc }
OutFile := ExpandConstant('{tmp}\check');
Command := 'powershell -ExecutionPolicy Bypass ';
Command := Command + 'Invoke-WebRequest -Uri "https://dl.espressif.com/dl/?system_check=win' + GetWindowsVersionString + '" -OutFile "' + OutFile + '-1.txt";';
Command := Command + 'Invoke-WebRequest -Uri "https://github.com/espressif" -OutFile "' + OutFile + '-2.txt";';
{Command := Command + 'Invoke-WebRequest -Uri "https://www.s3.amazonaws.com/" -OutFile "' + OutFile + '-3.txt";';}
Command := GetIdfEnvCommand('certificate verify --url https://dl.espressif.com/dl/?system_check=win' + GetWindowsVersionString);
ResultCode := SystemCheckExec(Command, ExpandConstant('{tmp}'));
if (ResultCode <> 0) then begin
SystemLog(' [' + CustomMessage('SystemCheckResultWarn') + ']');
SystemLog(CustomMessage('SystemCheckRootCertificateWarning'));
Exit;
end;
Command := GetIdfEnvCommand('certificate verify --url https://github.com/espressif');
ResultCode := SystemCheckExec(Command, ExpandConstant('{tmp}'));
if (ResultCode <> 0) then begin
SystemLog(' [' + CustomMessage('SystemCheckResultWarn') + ']');
SystemLog(CustomMessage('SystemCheckRootCertificateWarning'));
Exit;
end;
Command := GetIdfEnvCommand('certificate verify --url https://www.s3.amazonaws.com/');
ResultCode := SystemCheckExec(Command, ExpandConstant('{tmp}'));
if (ResultCode <> 0) then begin
SystemLog(' [' + CustomMessage('SystemCheckResultWarn') + ']');
SystemLog(CustomMessage('SystemCheckRootCertificateWarning'));
Expand Down

0 comments on commit 83757c6

Please sign in to comment.