"curl (35) tcp connection reset by peer"
- 오류는 일반적으로 TCP 연결이 응답을 받기 전에 서버 또는 네트워크 측에서 종료되거나 재설정되었음을 나타냅니다
원인
- 위 오류 메시지는 curl을 사용하여 YOUR_URL의 443번 포트로 연결을 시도했으나, 서버와 클라이언트 간의 공통된 암호화 알고리즘이 없기 때문에 안전한 연결을 협상할 수 없다는 것을 나타냅니다. 이러한 오류는 대개 서버 및 클라이언트 구성 불일치로 인해 발생
**
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.53.1 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
**
curl 7.79.1 (Windows) libcurl/7.79.1 Schannel
Release-Date: 2021-09-22
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI UnixSockets
해결책
- 이 문제는 클라이언트와 서버 간의
SSL/TLS 연결을 협상할 수 있는 암호화 알고리즘이 없어 발생하는 오류입니다. 이러한 오류는 대개 클라이언트 또는 서버 구성의 문제로 인해 발생합니다.
- 이 경우에는 오래된
NSS 라이브러리 사용으로 인한 오류 였으며, 해당 라이브러리 업데이트를 제안해서 해결
References
* About to connect() to YOUR_URL port 443 (
* Trying ::1...
* Connected to YOUR_URL (::1) port 443 (
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* NSS error -12286 (SSL_ERROR_NO_CYPHER_OVERLAP)
* Cannot communicate securely with peer: no common encryption algorithm(s).
* Closing connection 0
curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s).
다른 방안
- 도메인 URI로 호출 테스트 ex) devops.moon.co.kr/login
- 다른 도메인으로 curl 호출 테스트 ex) grafana.com
- curl과 같은 기능을 하는 REST API 호출 도구 사용
curl https://www.google.com
wget -O- https://www.google.com
http GET https://www.google.com
curl -Is https://devops.moon.co.kr
openssl s_client -connect devops.moon.co.kr:443