emsdk install fails with urlopen error [SSL: CERTIFICATE_VER



我正在尝试根据那里的说明在Windows下安装emsdk。我使用Windows(10.0.19045.2728新安装和更新,在一个虚拟机与开放的互联网访问)。我安装Python 3.11.3(作为管理员使用"Add Python .exe to PATH"),下载emsdk 2023-04-03并将其解压缩到emsdk文件夹,并在cmd.exe提示符下执行

> emsdk install latest
Resolving SDK alias 'latest' to '3.1.35'
Resolving SDK version '3.1.35' to 'sdk-releases-671550b5bdceee7bdb21493714f9a815aa5149a9-64bit'
Installing SDK 'sdk-releases-671550b5bdceee7bdb21493714f9a815aa5149a9-64bit'..
Installing tool 'node-14.18.2-64bit'..
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v14.18.2-win-x64.zip': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)>
Warning: Possibly SSL/TLS issue. Update or install Python SSL root certificates (2048-bit or greater) supplied in Python folder or https://pypi.org/project/certifi/ and try again.
error: installation failed!

我错过了什么?

我试着

  • pip install certifi(成功,但未治愈)
  • python emsdk.py install latest(无变化)
  • 使用Python 3.9.13(没有改变)
  • 在Mint 21.1虚拟机下使用相同的网络访问(它工作)

丑陋的解决方案:我成功地在download_file开始时在emsdk.py中插入了这个kludge

if url.startswith("https://storage.googleapis.com/"): # TODO fix/remove me
url = "http"+url[5:]    # change https to http      # TODO fix/remove me

值得称赞:运行他们的powershell脚本可以永久修复它!稍微编辑:

# This seems to update the machine cert store so that python can download the files as required by emscripten's install
$WebsiteURL="storage.googleapis.com"
Try {
$Conn = New-Object System.Net.Sockets.TcpClient($WebsiteURL,443) 

Try {
$Stream = New-Object System.Net.Security.SslStream($Conn.GetStream())
$Stream.AuthenticateAsClient($WebsiteURL) 
$Cert = $Stream.Get_RemoteCertificate()
$ValidTo = [datetime]::Parse($Cert.GetExpirationDatestring())

Write-Host "`nConnection Successfull" -ForegroundColor DarkGreen
Write-Host "Website: $WebsiteURL"
Write-Host "ValidTo: $ValidTo"
}
Catch { Throw $_ }
Finally { $Conn.close() }
}
Catch {
Write-Host "`nError occurred connecting to $($WebsiteURL)" -ForegroundColor Yellow
Write-Host "Website: $WebsiteURL"
Write-Host "Status:" $_.exception.innerexception.message -ForegroundColor Yellow
Write-Host ""
}

要将其保存为update-machine-certs.ps1运行,我需要发出

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser

我用 撤消的

Set-ExecutionPolicy -ExecutionPolicy Undefined    -Scope CurrentUser

输出为

Connection Successfull
Website: storage.googleapis.com
ValidTo: 06/12/2023 10:29:06

相关内容

最新更新