JDK 1.8.x javax.net.ssl.SSLException: Received fatal alert: protocol_version
See original GitHub issueStarting after Github updated their certificates I started to receive the below error message. Which is very similar to #634. With one exception, I’m running Java 1.8 which should default to TLS 1.2
I’ve found that restarting my jenkins instance resolves the issue. However it will start up again after some time. Restart always seems to resolve it, but that isn’t the ideal solution 😉
This is happening on two of my Jenkins environments each running different jenkins versions. (2.89.2 and 2.21). One is also running on linux, the other on osx.
I’m not sure if the issue is in this plugin or the underline github-api plugin. I do see this ticket: https://github.com/kohsuke/github-api/issues/418
Mar 02, 2018 1:11:07 PM hudson.triggers.Trigger checkTriggers
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
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
javax.net.ssl.SSLException: Received fatal alert - Stack Overflow
On Java 1.8 default TLS protocol is v1.2. On Java 1.6 and 1.7 default is obsoleted TLS1.0. I get this error on Java...
Read more >javax.net.ssl.SSLException: Received fatal alert
This error usually indicates that the incorrect TLS version is being used between Jenkins and the external application. Typically Jenkins expects TLS v1.2...
Read more >Received fatal alert: protocol_version when using java ...
Exception in thread "main" javax.net.ssl.SSLException: Received fatal alert: protocol_version at sun.security.ssl.Alerts.
Read more >fatal alert: Protocol Version - Visa Developer Community
SSLException : Received fatal alert: protocol_version. at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:666).
Read more >Caused by: javax.net.ssl.SSLException: Received fatal alert
I implemented a java code to call Oracle Cloud SOAP Webservice. From JDeveloper 11.1.1.9.0, It was working successfully and then suddenly it ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fingers crossed, but so far since I hardcoded the TLS version
-Dhttps.protocols=TLSv1.2
I haven’t seen the issue come up again.It bothers me that I’d have to do that since JDK 1.8 should default to 1.2. But maybe something is causing it fallback. Maybe a persistent connection or something like that. (grasping at straws)
Thanks so much @cybo42. @dmewadamobi on linux I added this to my bash file:
export JAVA_TOOL_OPTIONS="-Dhttps.protocols=TLSv1.2"
I’m not sure if there is a better place to put that though.