Difference between --cacert and --capath in curl?

前端 未结 2 886
情深已故
情深已故 2021-02-02 07:28

When would one use the --cacert option vs. the --capath option within curl (CLI that is).

--cacert appears to refer

2条回答
  •  不知归路
    2021-02-02 08:27

    On Windows you can run the following as a batch file and pass in the capath folder name:

    c_rehash.cmd:

    @echo off
    setlocal enableextensions enabledelayedexpansion
    if \%1\ EQU \\ goto :usage
    pushd %1
    if NOT ERRORLEVEL 0 goto :usage
    del *.0
    for %%I in (*.pem) do call :hash %%I
    popd
    goto :eof
    :hash
    for /F "usebackq" %%J in (`openssl x509 -in %1 -hash -noout`) do mklink %%J.0 %1
    goto :eof
    :usage
    echo Usage:
    echo.
    echo Rehash a folder of x509 Certificates for Curl
    echo.
    echo %~n0 ^
    

    Example:

    c_rehash c:\cacerts
    

提交回复
热议问题