본문 바로가기

DevOps/CI & CD

젠킨스에서 plugin 설치때 jenkins Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version 에러가 날 경우


젠킨스에서 plugin을 사용시 업데이트할때 아래와 같은 오류가 날 경우가 있다.


WARNING: org.jenkinsci.plugins.ghprb.GhprbTrigger.run() failed for hudson.model.FreeStyleProject@4853e929[android-phoenix-qa-emulator]
java.lang.Error: org.kohsuke.github.HttpException: Server returned HTTP response code: -1, message: 'null' for URL: https://api.github.com/repos/nytm/android-phoenix/pulls?state=open
        at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:516)
        at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:481)
        at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44)
        at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32)
        at org.kohsuke.github.PagedIterable.asList(PagedIterable.java:41)
        at org.kohsuke.github.GHRepository.getPullRequests(GHRepository.java:697)
        at org.jenkinsci.plugins.ghprb.GhprbRepository.check(GhprbRepository.java:138)
        at org.jenkinsci.plugins.ghprb.GhprbTrigger.run(GhprbTrigger.java:294)
        at hudson.triggers.Trigger.checkTriggers(Trigger.java:278)
        at hudson.triggers.Trigger$Cron.doRun(Trigger.java:226)
        at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.kohsuke.github.HttpException: Server returned HTTP response code: -1, message: 'null' for URL: https://api.github.com/repos/nytm/android-phoenix/pulls?state=open
        at org.kohsuke.github.Requester.parse(Requester.java:633)
        at org.kohsuke.github.Requester.parse(Requester.java:594)
        at org.kohsuke.github.Requester.access$200(Requester.java:73)
        at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:505)
        ... 17 more
Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
        at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
        at org.kohsuke.github.Requester.parse(Requester.java:602)
        ... 20 more

상기 에러는 TLS version issue 때문이라고 한다. 이에 따라 아래와 같은 셋팅을 수행하면 정상작동한다.


$ vi /etc/sysconfig/jenkins //Jenkins 설정 vi로 편집
JENKINS_JAVA_OPTIONS="-Dhttps.protocols=TLSv1.2" //추가

상기와 같은 설정 뒤에 jenkins restart를 수행하면 정상적으로 플러그인이 작동한다.


레퍼런스 : https://github.com/jenkinsci/ghprb-plugin/issues/634