Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 프로젝트에서 "PKIX path building failed" and "unable to find valid certification path to requested target 에러가 발생하는 경우 #170

Open
occidere opened this issue May 25, 2022 · 0 comments
Assignees
Labels

Comments

@occidere
Copy link
Owner

Java 프로젝트에서 "PKIX path building failed" and "unable to find valid certification path to requested target 에러가 발생하는 경우

상황

  • Java 기반 (JDK) 프로젝트 실행 시 소켓 연결 (크롤링 등 모든 네트워크 통신 포함) 시 PKIX path building failed" and "unable to find valid certification path to requested target 에러가 발생
  • 회사 VPN 이 켜져 있는 경우에만 발생하는 것으로 보아 VPN 이 사용하는 Certificates 가 등록되지 않는 인증서라서 발생하는 것으로 추측

해결

1. 브라우저에서 인증서 추출

image1
image2

2. 현재 사용중인 jdk 에 브라우저에서 추출한 인증서 추가

ex) 현재 jdk 경로와 추출한 인증서 경로

  • jdk 경로: /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home
  • 인증서 경로: ~/tmp/Zscaler\ Root\ CA.cer

아래 명령어로 인증서 추가

keytool -import -alias zscaler -keystore /Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home/lib/security/cacerts -file ~/tmp/Zscaler\ Root\ CA.cer

위 명령어를 실행하면 비밀번호를 물어보는데, 기본 비밀번호는 changeit

image

3. 재부팅 후 정상 동작 확인

참고

@occidere occidere added the Java label May 25, 2022
@occidere occidere self-assigned this May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant