smanders / externpro

build external projects with cmake
MIT License
13 stars 12 forks source link

curl and classified clone #355

Closed smanders closed 2 years ago

smanders commented 2 years ago

the cmake function xpClassifiedRepo() was enhanced to support PATH_URL https://github.com/smanders/externpro/issues/337 with commit https://github.com/smanders/externpro/commit/f1decd9659822e797609d0727eda192701330295

cURL is used to check that the PATH_URL specified points to a valid and reachable repository (web page) https://github.com/smanders/externpro/blob/22.03/modules/xpfunmac.cmake#L1589-L1599 -- if(statusCode EQUAL 200) then repoFound TRUE...

the curl executable used is the one built as part of externpro so that this function can use curl on Windows, whether cmake is run from the Windows environment (cmake-gui) or git-bash (cmake cli)

however, it appears that there is some kind of DNS issue on Windows (Linux works fine) with curl in our secure environment -- the statusCode returned is 000 using the curl from externpro, but works (statusCode 200) using curl from git-bash

curl (built via externpro) uses c-ares (a C library for asynchronous DNS requests, including name resolves)

this thread https://c-ares.org/mail/c-ares-archive-2011-02/0016.shtml "DNS issue with c-aress" mentions the hosts file, and sure enough: if we put the classified github system in the hosts file on Windows, curl + c-ares built via externpro works!

attack plan

smanders commented 2 years ago

current

smanders commented 2 years ago

2022.08.17 verified in the secure room that the previous curl (with cares/1.10) failed with statusCode 000, and the new curl (with cares/1.18.1) succeeds with statusCode 200

smanders commented 2 years ago

completed with commit referenced above