# Issue with ca-certificates and downloading a file

**URL:** https://discourse.cmake.org/t/issue-with-ca-certificates-and-downloading-a-file/3321
**Category:** Usage
**Tags:** os:linux
**Created:** [May 14, 2021, 10:43am UTC](https://discourse.cmake.org/t/issue-with-ca-certificates-and-downloading-a-file/3321 "2021-05-14T10:43:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rlemmon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/ebca7d/32.png) [@rlemmon](https://discourse.cmake.org/u/rlemmon)
#### Post date: [May 14, 2021, 10:43am UTC](https://discourse.cmake.org/t/issue-with-ca-certificates-and-downloading-a-file/3321/1 "2021-05-14T10:43:47Z")

</div>

Hi,

I have an issue with ca-certificates and downloading a file. Below is an example CMakeLists.txt.

```auto
# Specify the minimum version for CMake
cmake_minimum_required(VERSION 3.13.5)

# Project's name

project(hello)

file(DOWNLOAD "http://fastjet.fr/repo/fastjet-3.3.3.tar.gz" "fastjet-3.3.3.tar.gz" 
  TIMEOUT 60)

```

Below is the output of cmake

```auto
emmon@parton ~/example$ cmake .
CMake Error at CMakeLists.txt:8 (file):
  file /home/rlemmon/.guix-profile/etc/ssl/certs/ca-certificates.crt

-- Configuring incomplete, errors occurred!
See also "/home/rlemmon/example/CMakeFiles/CMakeOutput.log".

```

In fact, this is a small part of a much bigger cmake project that downloads and installs a suite of high energy physics programs (matplo/heppy on github) on my laptop (linux) using ExternalProject\_Add(). However I have narrowed down the issue to not being able to download the above file hence I use the simpler FILE command.

Note a few things:

- The file fastjet appears each time I run cmake but has 0 length.
- I can use the system version of curl or wget to download fastjet from the command line and it has normal size (not 0)
- I can download and install the file correctly in a Docker container with Debian base running on my laptop. However I would like to install it under the normal laptop conditions (Guix) …
- CMakeOutput.log does not contain fastjet for the command line presumable because the above CmakeLists.txt is a dummy file

I think the Guix package cmake has not been tested for such a situation, i.e. external files downloaded via curl.

Is it true that cmake runs with an internal version of curl ?

How can i build cmake so it uses the system version of curl ?

Thanks for your help.

Cheers  
Roy

---

<div class="post-metadata">

### Author: ![rlemmon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/ebca7d/32.png) [@rlemmon](https://discourse.cmake.org/u/rlemmon)
#### Post date: [May 21, 2021, 10:02am UTC](https://discourse.cmake.org/t/issue-with-ca-certificates-and-downloading-a-file/3321/2 "2021-05-21T10:02:53Z")

</div>

Bump.
