코드 내용입니다.
String tokenChangeUrl = “https://kauth.kakao.com/oauth/token”;
URL tokenUrl = new URL(tokenChangeUrl );
Map<String, Object> params = new LinkedHashMap<>();
params.put(“grant_type”, “refresh_token”);
params.put(“client_id”, KAKAO_CLIENT_ID);
params.put(refresh_token", scriptToken);
int cnt = 0;
String paramStr = “”;
for(Map.Entry<String, Object> param : params.entrySet()){
if(cnt != 0) paramStr += “&”;
paramStr += param.getKey() + “=” + URLEncoder.encode(String.valueOf(param.getValue()), “UTF-8”);
cnt++;
}
byte[] postDataBytes = postData.toString().getBytes(“UTF-8”);
HttpURLConnection postConn = (HttpURLConnection)tokenUrl.openConnection();
postConn.setRequestMethod(“POST”);
postConn.setRequestProperty(“Content-Type”, “application/x-www-form-urlencoded”);
postConn.setRequestProperty(“Content-Length”, String.valueOf(postDataBytes.length));
postConn.setDoOutput(true);
postConn.getOutputStream().write(postDataBytes);
InputStreamReader isr = new InputStreamReader(postConn.getInputStream(), “UTF-8”);
BufferedReader br = new BufferedReader(isr);
전에는 잘 되고 있었는데 어느순간부터
postConn.getOutputStream().write(postDataBytes); 이 부분에서
IOExceiption 으로
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
이라는 메세지가 뜹니다.
조치방법 부탁드립니다.