ConnectException: Received fatal alert: protocol_version when adding a member to my team

Hi,

i’m working on a java7 build app (1.7.0.79) & Play Framework. When i’m trying to add a new customer (ex : totototo) to my github orga (id : <MY_TEAM_ID>), i get this error (code hasn’t changed since months) :

RuntimeException occured : java.util.concurrent.ExecutionException: java.net.ConnectException: Received fatal alert: protocol_version to https://api.github.com/teams/<MY_TEAM_ID>/memberships/totototo

play.exceptions.JavaExecutionException: java.util.concurrent.ExecutionException: java.net.ConnectException: Received fatal alert: protocol_version to https://api.github.com/teams/<MY_TEAM_ID>/memberships/totototo
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:237)
        at Invocation.HTTP Request(Play!)
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.net.ConnectException: Received fatal alert: protocol_version to https://api.github.com/teams/<MY_TEAM_ID>/memberships/totototo
        at play.libs.ws.WSAsync$WSAsyncRequest.put(WSAsync.java:263)
        at controllers.snsrws.iot.IotDevelopers.gitRegistration(IotDevelopers.java:185)
        at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:557)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:508)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:484)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:479)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
        … 1 more
Caused by: java.util.concurrent.ExecutionException: java.net.ConnectException: Received fatal alert: protocol_version to https://api.github.com/teams/<MY_TEAM_ID>/memberships/totototo
        at com.ning.http.client.providers.netty.NettyResponseFuture.abort(NettyResponseFuture.java:297)
        at com.ning.http.client.providers.netty.NettyConnectListener.operationComplete(NettyConnectListener.java:104)
        at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:399)
        at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:385)
        at org.jboss.netty.channel.DefaultChannelFuture.setFailure(DefaultChannelFuture.java:352)
        at org.jboss.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1116)
        at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:995)
        at org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:656)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:317)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:207)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:94)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:372)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:246)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:38)
        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)
        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Received fatal alert: protocol_version to https://api.github.com/teams/<MY_TEAM_ID>/memberships/totototo
        at com.ning.http.client.providers.netty.NettyConnectListener.operationComplete(NettyConnectListener.java:100)
        … 22 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.SSLEngineImpl.fatal(SSLEngineImpl.java:1639)
        at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1607)
        at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1776)
        at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1068)
        at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:890)
        at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:764)
        at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
        at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:938)
        at org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:656)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:317)
        at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:207)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:94)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:372)
        at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:246)
        at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:38)
        … 3 more

It seems that it’s a well known problem with java7.

Any idea for it ? Thanks.

Best regards

Hi @csarrouilhe,

You mentioned that this is happening when you’re trying to add a new customer to your GitHub organization. Could you please give us some more details regarding the process that you’re using for this? Does the Java7 app connect to GitHub using the API?

You also mentioned that this seems to be a well-known problem in Java7. Do you have a link to the documentation where you found out about this problem?

Looking forward to hearing from you!

Hi Angela,

you’re right, my app is using github API.

It seems that Github is now (since when ?) only using protocol TLSv1.2 for clients.

My jdk7 app was using TLSv1 by default (jdk1.7.0_79) ( https://blogs.oracle.com/java-platform-group/diagnosing-tls,-ssl,-and-https ).

Since jdk7u131, TLS v1.1 and v1.2 are added to the client list of default-enabled protocols ( http://www.oracle.com/technetwork/java/javaseproducts/documentation/javase7supportreleasenotes-1601161.html#R170_131 ).

Best regards

Christophe

Hi @csarrouilhe,

About a week ago, GitHub permanently removed support for TLSv1/TLSv1.1 and other crpytographic standards that are now considered to be weak. You can read more about the change in this GitHub blog post.

Thanks!

This error to due to maven was installed in you system…

follow the below steps

  1. delete the c:\Users.m2 or related directory in windows (Not sure about Unix or Mac but you can find the local cache of maven. Delete .m2 directory)

  2. delete maven related environment variable.

  3. delete ./gradlew

  4. delete environment variable related to groovy also

try to above step… it will work fine