728x90
๋ฐ์ํ
๐ ๋ฌธ์ ์ํฉ
IntelliJ์ .http ํ์ผ์์ HTTPS API ํ ์คํธ ์ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค:
POST https://211.111.222.333:9500/api/auth/login
javax.net.ssl.SSLHandshakeException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
๐ ์์ธ
์ด ์ค๋ฅ๋ SSL/TLS ์ธ์ฆ์ ๊ฒ์ฆ ์คํจ๋ก ๋ฐ์ํ๋ฉฐ, ์ฃผ๋ก ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ์ ๋ํ๋ฉ๋๋ค:
- ์๋ฒ๊ฐ ์์ฒด ์๋ช ๋ ์ธ์ฆ์(Self-signed Certificate) ์ฌ์ฉ
- ์ธ์ฆ์๊ฐ ๊ณต์ธ ์ธ์ฆ ๊ธฐ๊ด(CA)์์ ๋ฐ๊ธ๋์ง ์์
- ๊ฐ๋ฐ/ํ ์คํธ ํ๊ฒฝ์ ์์ ์ธ์ฆ์ ์ฌ์ฉ
- ์ธ์ฆ์ ์ฒด์ธ์ด ๋ถ์์ ํ๊ฑฐ๋ ๋ง๋ฃ๋จ
โ ํด๊ฒฐ ๋ฐฉ๋ฒ
๋ฐฉ๋ฒ 1: .http ํ์ผ์์ SSL ๊ฒ์ฆ ๋นํ์ฑํ (๊ฐ์ฅ ๊ฐ๋จ)
//http-client.env.json ํ์ผ
{
"loc": {
"host": "http://localhost:9500",
"json": "application/json"
},
"dev": {
"host": "http://211.111.222.333:9500",
"json": "application/json"
},
"dev-insecure": {
"host": "https://211.111.222.333:9500",
"json": "application/json",
"SSLConfiguration": {
"verifyHostCertificate": false
}
}
}

Server Certificates ๊ฒฝ๋ก๋ก ๊ฐ์ “Accept non-trusted certificates automatically” ์ต์ ์ ์ผ๋ฉด, ์ ๋ขฐ๋์ง ์๋ ์ธ์ฆ์๋ฅผ ์๋์ผ๋ก ํ์ฉํ๋๋ก ์์
728x90
๋ฐ์ํ