지도/로컬 API에 대한 문의게시판입니다.
localhost(개발PC)에서 PKIX path building failed 발생합니다.
개발 윈도우 PC에서 설정인데 ssl 인증 연결을 해야 하나요?
http://localhost:8080 에서 기존 연결되었던 상태였습니다.
(기존 사용하고 있던 키인데 최근에 연결이 안되고 있습니다.)
소스 첨부합니다.
String app_key = EgovProperties.getProperty(“kakao.map.app.rest.key”);
String kakaoUrl = “https://dapi.kakao.com/v2/local/search/address.json?query=” + URLEncoder.encode(mapoOneStopVo.getMotAddr1() + " " + mapoOneStopVo.getMotAddr2(), “UTF-8”);
String reqJson = new String();
String buf;
URL Url = new URL(kakaoUrl);
HttpsURLConnection conn = (HttpsURLConnection) Url.openConnection();
String auth ="KakaoAK " +app_key;
conn.setRequestMethod("GET");
conn.setRequestProperty("X-Requested-With", "curl");
conn.setRequestProperty("Authorization", auth);
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
while((buf = br.readLine()) != null) {
reqJson += buf;
}
JSONParser paser = new JSONParser();
JSONObject json = (JSONObject)paser.parse(reqJson);
JSONObject meta = (JSONObject) json.get("meta");
개발PC (윈도우PC, http://localhost:8080)에서 오류 :
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target