/ / Jak mogę uruchomić cURL z wiersza poleceń systemu Windows? - okna, curl

Jak mogę uzyskać polecenie cURL do pracy z wiersza poleceń systemu Windows? - okna, curl

Pobrałem cURL dla Windows z tutaj. Wybrałem Win64 - Generic wersja bez SSL. Próbuję biec curl https://www.google.com z wiersza poleceń i pojawia się następujący błąd: curl: (1) Protocol https not supported or disabled in libcurl.

W porządku! Następnie decyduję się pobrać wersję za pomocą SSL i zainstaluj to. Próbuję uruchomić to samo polecenie jak powyżej i pojawia się następujący błąd:

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle" of Certificate
Authority (CA) public keys (CA certs). If the default bundle file isn"t adequate, you
can specify an alternate file using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you"d like to turn off curl"s verification of the certificate, use
the -k (or --insecure) option.

Co powinienem zrobić dalej?

Odpowiedzi:

3 dla odpowiedzi № 1

Oto, co zrobiłem, aby rozwiązać problem.

Mam pakiet certyfikatów głównych CA, z którego korzysta Mozilla tutaj. Skopiowałem dane ze strony i zapisałem je w nowym pliku o nazwie curl-ca-bundle.crt w folderze, w którym curl.exe plik był. To rozwiązało problem.

Oczywiście instrukcje te znajdują się również w cURL strona dokumentacji certyfikatów SSL, dokładnie instrukcje 4 i 5.

Nadzieja, która pomaga.