상세 컨텐츠

본문 제목

2020.12.24 STS SunCertPathBuilderException shooting

보안/java

by MustThanks 2020. 12. 24. 15:03

본문

반응형

STS  SunCertPathBuilderException 해결법

   Spring Starter Project 선택을 하면  발생되는 SunCertPathBuilderException 에러 발생을 해결

 

 1 Crome 을 이용하여 아래의 경로로 접근

Crome run
  url : https://https://start.spring.io/  접근
  

2. 잠물쇠 를   마우스로  클릭( click right button of mouse)

 

3. 인증서 선택 (click certificate)

 

4. 자세히 선택 (click detail tab )

5. 파일에 복사를 선택 (click  copy to file )

 

6. 다음 클릭(click next)

7.  라디오 버튼 클릭 후 다음 선택(chose next button after select radio buttom)

 

8.  찾아보기 클릭 click find buttom

    경로를 선택 한 이후 저장할 파일명 작성(after click find buttom write filename)

9. 저장을 위한 파일명 작성 완료(defined save filename and click next buttom) 이후 다음을 클릭

10. 마침을 클릭(click finsh)

 

 

 

JAVA에 내보낸 인증서를 추가

 

1. cmd창 실행
2. cd %JAVA_HOME%\bin
3. 인증서 추가 
     keytool -importcert -alias your-alias -keystore "%JRE_HOME%\lib\security\cacerts" -storepass changeit -file {다운받은 인증서 경로}
4. STS.ini 에 아래의 두 줄을 추가
   -Djavax.net.ssl.trustStore=%JRE_HOME%\lib\security\cacerts
    -Djava.net.ssl.trustStorePassword=changeit
5. STS 실행

C:\Temp\tools\jdk-11\keystore>C:\Temp\tools\jdk-11\bin\keytool -importcert -alias spring_alias -keystore "C:\Temp\tools\jdk-11\lib\security\cacerts" -storepass changeit -file "C:\Temp\tools\jdk-11\keystore\springIo.cer"
Warning: use -cacerts option to access cacerts keystore
Owner: CN=*.spring.io, OU=Spring, O="Pivotal Software, Inc.", L=Palo Alto, ST=California, C=US
Issuer: CN=Somansa Root CA, O=Somansa, C=KR
Serial number: 5968c617929aa436
Valid from: Tue Mar 10 09:00:00 KST 2020 until: Wed Apr 28 21:00:00 KST 2021
Certificate fingerprints:
         SHA1: D3:B4:94:8C:58:3E:A6:45:7A:94:AC:D2:04:7B:03:2D:82:09:F3:30
         SHA256: E4:78:D0:79:A7:3D:8D:A4:89:7C:06:29:B8:56:2E:7F:CC:38:2B:BE:2B:DF:A1:93:C9:DC:4C:9A:E2:02:AD:26
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions:

#1: ObjectId: 1.3.6.1.4.1.11129.2.4.2 Criticality=false
0000: 04 81 F2 00 F0 00 76 00   F6 5C 94 2F D1 77 30 22  ......v..\./.w0"
0010: 14 54 18 08 30 94 56 8E   E3 4D 13 19 33 BF DF 0C  .T..0.V..M..3...
0020: 2F 20 0B CC 4E F1 64 E3   00 00 01 70 C5 3B D4 54  / ..N.d....p.;.T
0030: 00 00 04 03 00 47 30 45   02 20 27 F9 C4 DA 2C EE  .....G0E. '...,.
0040: 61 27 2D F9 33 CA 1E 69   A4 6D 6B AB FB 76 16 71  a'-.3..i.mk..v.q
0050: 71 DD 42 39 E0 62 D5 D2   DE D8 02 21 00 DD 70 6E  q.B9.b.....!..pn
0060: D0 CE 6E 0D 50 9D 42 02   2A 62 C3 63 3B 30 8B 15  ..n.P.B.*b.c;0..
0070: 97 7A 2E EB 01 68 F3 16   F3 1A 5D FB 2B 00 76 00  .z...h....].+.v.
0080: 5C DC 43 92 FE E6 AB 45   44 B1 5E 9A D4 56 E6 10  \.C....ED.^..V..
0090: 37 FB D5 FA 47 DC A1 73   94 B2 5E E6 F6 C7 0E CA  7...G..s..^.....
00A0: 00 00 01 70 C5 3B D4 AB   00 00 04 03 00 47 30 45  ...p.;.......G0E
00B0: 02 20 58 D0 BE 87 9C 24   62 48 E5 E3 11 20 70 6A  . X....$bH... pj
00C0: 33 E7 92 EB 31 3E 4B EB   EB EF 20 26 78 F9 14 C6  3...1>K... &x...
00D0: 3D FF 02 21 00 AD 0A EC   F1 02 1F 72 A3 D0 EE 76  =..!.......r...v
00E0: DF 39 50 A6 55 9D 17 C7   3D B6 05 FA CF 5A 95 3D  .9P.U...=....Z.=
00F0: DF 3B 78 33 3B                                     .;x3;


#2: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: B2 83 2C 50 73 E9 90 A2   CD 6C E8 C2 2D 60 25 EE  ..,Ps....l..-`%.
0010: A1 64 65 46                                        .deF
]
]

#3: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
  CA:false
  PathLen: undefined
]

#4: ObjectId: 2.5.29.37 Criticality=false
ExtendedKeyUsages [
  serverAuth
  clientAuth
]

#5: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
  DigitalSignature
  Key_Encipherment
]

#6: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
  DNSName: *.spring.io
  DNSName: spring.io
]

#7: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 83 A8 ED 0C 5C 65 D1 98   82 16 E5 B3 A0 5F D6 D2  ....\e......._..
0010: 2F 14 04 6A                                        /..j
]
]

Trust this certificate? [no]:  yes
Certificate was added to keystore

'보안 > java' 카테고리의 다른 글

2020.12.28 gradle  (0) 2020.12.28
2020.12.28 ssh lib  (0) 2020.12.28
2020.12.24 Keystore  (0) 2020.12.24
2020.12.24 keytool 유틸리티를 사용하여 인증서 생성  (0) 2020.12.24
java 1.8 open jdk and spring sts tools  (0) 2020.12.23

관련글 더보기

댓글 영역