Check CMake TLS SSL

CMake itself is built with SSL by default. Most Internet sites require SSL / TLS to function. Confusing errors result for CMake network operations like file(DOWNLOAD) may result if CMake is built without SSL support.

CMake has a simple capabilities check:

cmake_minimum_required(VERSION 3.25)

execute_process(COMMAND ${CMAKE_COMMAND} -E capabilities OUTPUT_VARIABLE cap)

string(JSON has_tls GET "${cap}" "tls")

message(STATUS "${CMAKE_COMMAND} TLS available: ${has_tls}")

To progamatically confirm that TLS and certificates are working, consider check_tls.

For a more complete check consider check_https.cmake