dom96 / choosenim

Tool for easily installing and managing multiple versions of the Nim programming language.
BSD 3-Clause "New" or "Revised" License
682 stars 65 forks source link

SSL error on Windows #251

Closed jiro4989 closed 2 years ago

jiro4989 commented 3 years ago

It looks like choosenim doesn't come with the certificates it needs.

  Verifying dependencies for tridactyl_native@
    Reading official package list
    Prompt: No local packages.json found, download it from internet? -> [forced yes]
Downloading Official package list
     Trying https://github.com/nim-lang/packages/raw/master/packages.json
   Warning: Could not download: No SSL/TLS CA certificates found.
     Trying https://irclogs.nim-lang.org/packages.json
     Trying https://nim-lang.org/nimble/packages.json
     Error: Refresh failed
        ... Could not download: No SSL/TLS CA certificates found.
Error: Process completed with exit code 1.

https://github.com/tridactyl/native_messenger/runs/1998216729?check_suite_focus=true

It was a pretty easy fix:

https://github.com/tridactyl/native_messenger/pull/41/files

https://github.com/jiro4989/setup-nim-action/issues/41


And I got this problem too.

PS C:\Users\jiro4989\Downloads\choosenim> nimble install rena
    Prompt: No local packages.json found, download it from internet? [y/N]
    Answer: y
Downloading Official package list
       Tip: 5 messages have been suppressed, use --verbose to show them.
     Error: Refresh failed
        ... Could not download: No SSL/TLS CA certificates found.
PS C:\Users\jiro4989\Downloads\choosenim>

PS C:\Users\jiro4989\Downloads\choosenim> nim -v
Nim Compiler Version 1.4.4 [Windows: amd64]
Compiled at 2021-02-23
Copyright (c) 2006-2020 by Andreas Rumpf

active boot switches: -d:release

PS C:\Users\jiro4989\Downloads\choosenim> nimble -v
nimble v0.13.1 compiled at 2021-02-23 00:57:46
git hash: couldn't determine git hash
PS C:\Users\jiro4989\Downloads\choosenim>

I installed nim with choosenim-0.7.4_windows_amd64.zip .

jiro4989 commented 3 years ago

But, nimble install rena passed when run choosenim 1.4.2.

PS C:\Users\jiro4989\Downloads> nimble install rena
    Prompt: No local packages.json found, download it from internet? [y/N]
    Answer: y
Downloading Official package list
       Tip: 5 messages have been suppressed, use --verbose to show them.
     Error: Refresh failed
        ... Could not download: No SSL/TLS CA certificates found.

PS C:\Users\jiro4989\Downloads> .\choosenim-0.7.4_windows_amd64.exe 1.4.2
      Info: C:\Users\jiro4989\.choosenim\downloads\dlls.zip already downloaded
 Extracting dlls.zip
      Info: Copied 'cacert.pem' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libcurl.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libeay32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libeay64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pcre.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pcre32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pcre64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pdcurses.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pdcurses32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pdcurses64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'sqlite3_32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'sqlite3_64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'ssleay32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'ssleay64.dll' to 'C:\Users\jiro4989\.nimble\bin'
Downloading Nim 1.4.2 from nim-lang.org
[##################################################] 100.0% 0kb/s
 Extracting nim-1.4.2_x64.zip
   Building Nim 1.4.2
  Compiler: Already built
     Tools: Already built
   Switched to Nim 1.4.2

PS C:\Users\jiro4989\Downloads> nimble install rena
    Prompt: No local packages.json found, download it from internet? [y/N]
    Answer: y
Downloading Official package list
    Success Package list downloaded.
Downloading https://github.com/jiro4989/rena using git
  Verifying dependencies for rena@1.0.0
 Installing cligen@>= 0.9.32
Downloading https://github.com/c-blake/cligen.git using git
  Verifying dependencies for cligen@1.5.0
 Installing cligen@1.5.0
   Success: cligen installed successfully.
 Installing rena@1.0.0
   Building rena/rena.exe using c backend
   Success: rena installed successfully.

PS C:\Users\jiro4989\Downloads>
jiro4989 commented 3 years ago

This was passed.

$ choosenim 1.4.4
$ choosenim 1.4.2
$ nimble install rena
PS C:\Users\jiro4989\Downloads> .\choosenim-0.7.4_windows_amd64.exe 1.4.4
    Prompt: Can choosenim record and send anonymised telemetry data? [y/n]
        ... Anonymous aggregate user analytics allow us to prioritise
        ... fixes and features based on how, where and when people use Nim.
        ... For more details see: https://goo.gl/NzUEPf.
    Answer: y
Downloading C compiler (Mingw64)
[##################################################] 100.0% 0kb/s
 Extracting mingw64.7z
Downloading DLLs (openssl, pcre, ...)
[##################################################] 100.0% 0kb/s
Downloading Nim 1.4.4 from nim-lang.org
 Extracting nim-1.4.4_x64.zip
   Building Nim 1.4.4
  Compiler: Already built
     Tools: Already built
  Installed component 'nim'
  Installed component 'nimble'
  Installed component 'nimgrep'
  Installed component 'nimpretty'
  Installed component 'nimsuggest'
  Installed component 'testament'
  Installed component 'nim-gdb'
  Installed component 'gcc'
  Installed component 'g++'
  Installed component 'gdb'
  Installed component 'ld'
   Switched to Nim 1.4.4

PS C:\Users\jiro4989\Downloads> .\choosenim-0.7.4_windows_amd64.exe 1.4.2
      Info: C:\Users\jiro4989\.choosenim\downloads\dlls.zip already downloaded
 Extracting dlls.zip
      Info: Copied 'cacert.pem' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libcurl.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libeay32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libeay64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pcre.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pcre32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pcre64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pdcurses.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pdcurses32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'pdcurses64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'sqlite3_32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'sqlite3_64.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'ssleay32.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'ssleay64.dll' to 'C:\Users\jiro4989\.nimble\bin'
Downloading Nim 1.4.2 from nim-lang.org
[##################################################] 100.0% 0kb/s
 Extracting nim-1.4.2_x64.zip
   Building Nim 1.4.2
  Compiler: Already built
     Tools: Already built
   Switched to Nim 1.4.2

PS C:\Users\jiro4989\Downloads> .\choosenim-0.7.4_windows_amd64.exe 1.4.4
   Switched to Nim 1.4.4

PS C:\Users\jiro4989\Downloads> nimble install rena
    Prompt: No local packages.json found, download it from internet? [y/N]
    Answer: y
Downloading Official package list
    Success Package list downloaded.
Downloading https://github.com/jiro4989/rena using git
  Verifying dependencies for rena@1.0.0
 Installing cligen@>= 0.9.32
Downloading https://github.com/c-blake/cligen.git using git
  Verifying dependencies for cligen@1.5.0
 Installing cligen@1.5.0
   Success: cligen installed successfully.
 Installing rena@1.0.0
   Building rena/rena.exe using c backend
   Success: rena installed successfully.

PS C:\Users\jiro4989\Downloads>

dlls.zip was extracted when run choosenim 1.4.2. dlls.zip may be not extracted when run choosenim 1.4.4.

PS C:\Users\jiro4989\Downloads> .\choosenim-0.7.4_windows_amd64.exe 1.4.2
      Info: C:\Users\jiro4989\.choosenim\downloads\dlls.zip already downloaded
 Extracting dlls.zip
      Info: Copied 'cacert.pem' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libcurl.dll' to 'C:\Users\jiro4989\.nimble\bin'
      Info: Copied 'libeay32.dll' to 'C:\Users\jiro4989\.nimble\bin'
dom96 commented 3 years ago

the SSL error is coming from nimble and choosenim should download the dlls file to get the necessary deps for Nimble. That zip should contain the certs.

I'm quite confused by all the output you've shown, has it resolved itself?

jiro4989 commented 3 years ago

Not yet. I think that there are any problems.

dlls.zip was not extracted when run choosenim 1.4.4.

PS C:\Users\jiro4989\Downloads> .\choosenim-0.7.4_windows_amd64.exe 1.4.4
    Prompt: Can choosenim record and send anonymised telemetry data? [y/n]
        ... Anonymous aggregate user analytics allow us to prioritise
        ... fixes and features based on how, where and when people use Nim.
        ... For more details see: https://goo.gl/NzUEPf.
    Answer: y
Downloading C compiler (Mingw64)
[##################################################] 100.0% 0kb/s
 Extracting mingw64.7z
Downloading DLLs (openssl, pcre, ...)
[##################################################] 100.0% 0kb/s
 Extracting dlls.zip
Downloading Nim 1.4.4 from nim-lang.org
[##################################################] 100.0% 0kb/s
 Extracting nim-1.4.4_x64.zip
   Building Nim 1.4.4
  Compiler: Already built
     Tools: Already built
  Installed component 'nim'
  Installed component 'nimble'
  Installed component 'nimgrep'
  Installed component 'nimpretty'
  Installed component 'nimsuggest'
  Installed component 'testament'
  Installed component 'nim-gdb'
  Installed component 'gcc'
  Installed component 'g++'
  Installed component 'gdb'
  Installed component 'ld'
   Switched to Nim 1.4.4

PS C:\Users\jiro4989\Downloads> dir ..\.choosenim\downloads\

    ディレクトリ: C:\Users\jiro4989\.choosenim\downloads

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2021/03/06     14:06        4315179 dlls.zip
-a----        2021/03/06     14:06       66691071 mingw64.7z

This extract may be failed.

https://github.com/dom96/choosenim/blob/master/src/choosenimpkg/utils.nim#L51