CMAKE_TLS_VERIFY — CMake 4.0.1 Documentation

# CMAKE_TLS_VERIFY

Specify the default value for the `file(DOWNLOAD)` and `file(UPLOAD)` commands' `TLS_VERIFY` options. If this variable is not set, the commands check the `CMAKE_TLS_VERIFY` environment variable. If neither is set, the default is on.

Changed in version 3.31: The default is on. Previously, the default was off. Users may set the `CMAKE_TLS_VERIFY` environment variable to `0` to restore the old default.

This variable is also used by the `ExternalProject` and `FetchContent` modules for internal calls to `file(DOWNLOAD)`.

TLS verification can help provide confidence that one is connecting to the desired server. When downloading known content, one should also use file hashes to verify it.

    set(CMAKE_TLS_VERIFY TRUE)