
문제 없이 다음을 수행할 수 있습니다.
curl -u "username:password" http://www.example.com/exportfile.xml
하지만 우리 사이트의 https 버전에 동일한 명령을 사용하려고 하면 실패합니다.
curl -u "username:password" https://www.example.com/exportfile.xml
오류 메시지는 다음과 같습니다.
About to connect() to www.example.com port 443 (#0)
Trying "some ip"... connected
Connected to www.example.com (some ip) port 443 (#0)
Initializing NSS with certpath: sql:/etc/pki/nssdb
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
NSS error -5938
Closing connection #0
SSL connect error
curl: (35) SSL connect error
모든 도움을 주셔서 감사합니다
답변1
매개변수를 사용해 보세요 -k/--insecure
.
매뉴얼 페이지에서:
(SSL) 이 옵션은 컬이 "안전하지 않은" SSL 연결 및 전송을 수행하도록 명시적으로 허용합니다. 모든 SSL 연결은 기본적으로 설치된 CA 인증서 번들을 사용하여 보안을 유지하려고 시도됩니다. 이렇게 하면 "안전하지 않은" 것으로 간주되는 모든 연결이
-k, --insecure
사용되지 않는 한 실패하게 됩니다.
$ curl -sku "username:password" "https://www.example.com/exportfile.xml"
-s/--silent
나는 무언가를 다운로드하거나 통계를 보고 싶은 경우를 제외하고는 항상 매개변수를 사용하는 것을 선호합니다 .
또한 -s
매개변수를 사용하면 매개변수를 사용할 때 자세한 출력이 방지되지 않습니다 -v
.