사내 웹필터로 발생한 SSL Verification
Published on September 10, 2025 by 강준우
gem SSL Verification ERROR Root Certificate
6 min READ
사내 웹필터 적용을 위해 Windows에 사설 CA를 추가하면서 jekyll 및 bundler가 gem으로 설치되지 않는 문제가 발생하였습니다.
그 문제 원인을 찾고 해결하는 과정을 정리해보겠습니다.
OS: windows
Shell: PowerShell
아래와 같이 gem install
명령어를 치는 경우에 발생한 error log입니다.
gem install bundler jekyll
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 ***생략*** state=error: certificate verify failed (self-signed certificate in certificate chain) (https://rubygems.org/specs.4.8.gz)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: Could not find a valid gem 'jekyll' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 ***생략*** state=error: certificate verify failed (self-signed certificate in certificate chain) (https://rubygems.org/specs.4.8.gz)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
ERROR: SSL verification error at depth 1: self-signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=***생략***/ePrism SSL)
사내 웹 필터를 적용하며 사설 CA를 사용하였고 이로 인한 문제가 발생한 것 같았습니다. 보이는 “/C=***생략***/ePrism SSL”는 현재 사설 CA가 위치한 경로입니다.
현재 Error Code도 말해주는 것은 회사/게이트웨이(“ePrism SSL”)가 TLS 가로채기(SSL inspection)를 하고있다. 라는 것입니다. 루비(gem)가 사용하는 CA 번들이 사내 루트 인증서를 모르니 “self-signed certificate in certificate chain / Root certificate is not trusted” 로 실패하는 것입니다.
해결 방법은 “사내 루트 CA를 신뢰 목록에 추가”하는 것입니다.
원인과 해결 방법은 파악했으나 사실 무슨 말인지 전혀 모르겠어서 정리해보고자 합니다.
👉문제는 여기서 발생하는 데 사설 CA는 전세계 공인 루트 목록에 없기 때문에, OS/브라우저/프로그램이 “이거 믿을 수 없어”라고 하고 SSL 오류를 냅니다.
이제 본격적으로 트러블 슈팅을 해봅시다. 아래 순서대로 진행하되 저는 단순히 Windows에 CA를 추가한다고 문제를 해결하지 못했습니다. 그러다가 3번 과정을 진행하면서 문제가 해결되었음을 알려드립니다. 2번 만으로도 끝나셨다면 축복 드립니다.
저는 제 사수에게 CA를 받았습니다.
win + R
-> mmc
입력 -> 엔터파일
-> 스냅인 추가/제거
👉 이제 Windows 전체가 ePrisme CA를 신뢰합니다.
하지만 저는 여전히 해결되지 않았습니다. 브라우저에서 인증서를 확인해보니 브라우저는 그 인증서를 신뢰하고 있다는 메세지를 확인하였습니다.
그렇다면 OS나 브라우저에서의 문제가 아니라고 판단하고 원인 파악을 이어나갔습니다.
Ruby는 Windows에서 OpenSSL을 쓰는데, 기본 번들에 ePrism이 안 들어가 있으니 경로를 지정해줍니다.
gem env
# 루비가 어떤 번들을 보게 됐는지 확인
ruby -ropenssl -e "puts 'USE=' + (ENV['SSL_CERT_FILE'] || OpenSSL::X509::DEFAULT_CERT_FILE)"
# 아래와 같이 나오면 성공
# DEFAULT_CERT_FILE=C:/Ruby34-x64/lib/ruby/3.4.0/etc/ssl\cert.pem
# DEFAULT_CERT_DIR=C:/Ruby34-x64/lib/ruby/3.4.0/etc/ssl\certs
# Gem 소스 초기화(캐시 클리어)
gem sources --clear-all
사설 CA 합치기
위에서 나온 # DEFAULT_CERT_FILE
경로의 pem 값을 notepad로 열고 기존에 받은 사설 CA도 notepad로 열어서 복사하여 맨 아래 붙여넣기를 합니다. 참고로 -----BEGIN CERTIFICATE-----
로 시작해야하고, -----BEGIN CERTIFICATE-----
부터 -----END CERTIFICATE-----
까지 모두 복사해야합니다.
확인 및 설치 재시도
여기까지 정상적으로 완료했다면 아래 명령어를 복사하여 다시 재설치 해봅시다.
# Ruby가 어떤 cert 번들을 쓰는지 확인
ruby -ropenssl -e "puts 'USE=' + (ENV['SSL_CERT_FILE'] || OpenSSL::X509::DEFAULT_CERT_FILE)"
# Gem 캐시 초기화
gem sources --clear-all
# 설치 (상세 로그 확인)
gem install bundler jekyll -V
https://rubygems.org/
net/http
+ openssl
사용.