{"action":"created","issue":{"url":"https://api.github.com/repos/gocd/gocd/issues/1381","labels_url":"https://api.github.com/repos/gocd/gocd/issues/1381/labels{/name}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/1381/comments","events_url":"https://api.github.com/repos/gocd/gocd/issues/1381/events","html_url":"https://github.com/gocd/gocd/issues/1381","id":97162933,"number":1381,"title":"Agent cannot register due to javax.net.ssl.SSLHandshakeException","user":{"login":"JamesMGreene","id":417751,"avatar_url":"https://avatars.githubusercontent.com/u/417751?v=3","gravatar_id":"","url":"https://api.github.com/users/JamesMGreene","html_url":"https://github.com/JamesMGreene","followers_url":"https://api.github.com/users/JamesMGreene/followers","following_url":"https://api.github.com/users/JamesMGreene/following{/other_user}","gists_url":"https://api.github.com/users/JamesMGreene/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesMGreene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesMGreene/subscriptions","organizations_url":"https://api.github.com/users/JamesMGreene/orgs","repos_url":"https://api.github.com/users/JamesMGreene/repos","events_url":"https://api.github.com/users/JamesMGreene/events{/privacy}","received_events_url":"https://api.github.com/users/JamesMGreene/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-07-24T22:46:13Z","updated_at":"2016-01-04T13:48:22Z","closed_at":null,"body":"**Go Server version:** `15.1.0-1863`\r\n\r\n**Go Server Java version:**\r\n```\r\njava version \"1.7.0_79\"\r\nOpenJDK Runtime Environment (amzn-2.5.5.1.59.amzn1-x86_64 u79-b14)\r\nOpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)\r\n```\r\n\r\n**Go Agent version:** `15.1.0-1863`\r\n\r\n**Go Agent Java version:**\r\n```\r\njava version \"1.7.0_85\"\r\nOpenJDK Runtime Environment (amzn-2.6.1.3.61.amzn1-x86_64 u85-b01)\r\nOpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)\r\n```\r\n\r\n---\r\n\r\n### Logs\r\n\r\n**Tail of `/var/log/go-agent-bootstrapper.log`:**\r\n\r\n```\r\n[Fri Jul 24 17:12:52 CDT 2015] Starting Go Agent Bootstrapper with command: /usr/lib/jvm/java-1.7.0/bin/java -jar \"/usr/share/go-agent/agent-bootstrapper.jar\" 123.45.67.89 8153\r\n[Fri Jul 24 17:12:52 CDT 2015] Starting Go Agent Bootstrapper in directory: /var/lib/go-agent\r\n[Fri Jul 24 17:12:52 CDT 2015] AGENT_STARTUP_ARGS=-Dcruise.console.publish.interval=10 -Xms128m -Xmx256m\r\nlogFile Environment Variable= /var/log/go-agent/go-agent-bootstrapper.log\r\nLogging to /var/log/go-agent/go-agent-bootstrapper.log\r\n2015-07-24 22:12:52,813 [main     ] INFO  agent.common.util.JarUtil:68 - Attempting to load Go-Agent-Launcher-Class from 225a66c6-9726-4d4b-b22c-f334b36bd15fagent-launcher.jar File:\r\n2015-07-24 22:12:52,815 [main     ] INFO  agent.common.util.JarUtil:77 - manifestLibDirKey: Go-Agent-Launcher-Lib-Dir: libs\r\n2015-07-24 22:12:52,835 [main     ] INFO  agent.common.util.JarUtil:83 - manifestClassKey: Go-Agent-Launcher-Class: com.thoughtworks.cruise.agent.launcher.AgentLauncherImpl\r\n2015-07-24 22:12:52,836 [main     ] INFO  agent.common.util.ParentClassAccessFilteringClassloader:43 - Loading com.thoughtworks.cruise.agent.common.launcher.AgentLauncher using com.simontuffs.onejar.JarClassLoader\r\n2015-07-24 22:12:52,872 [main     ] INFO  go.agent.bootstrapper.AgentBootstrapper:72 - Attempting create and start launcher...\r\n2015-07-24 22:12:52,907 [main     ] INFO  agent.common.util.ParentClassAccessFilteringClassloader:43 - Loading com.thoughtworks.cruise.agent.common.launcher.AgentLaunchDescriptor using com.simontuffs.onejar.JarClassLoader\r\n0 [TouchLoopThread-2] INFO com.thoughtworks.go.agent.launcher.Lockfile  - Using lock file: /var/lib/go-agent/.agent-bootstrapper.running\r\n270 [main] INFO com.thoughtworks.go.agent.common.util.JarUtil  - Attempting to load Go-Agent-Bootstrap-Class from agent.jar File:\r\n271 [main] INFO com.thoughtworks.go.agent.common.util.JarUtil  - manifestClassKey: Go-Agent-Bootstrap-Class: com.thoughtworks.go.agent.AgentProcessParentImpl\r\n273 [main] INFO com.thoughtworks.go.agent.AgentProcessParentImpl  - Agent is version: 15.1.0\r\n391 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - download started at Fri Jul 24 22:12:53 UTC 2015\r\n396 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - got server response at Fri Jul 24 22:12:53 UTC 2015\r\n421 [main] INFO com.thoughtworks.go.agent.launcher.ServerBinaryDownloader  - pipe the stream to admin/agent-plugins.zip at Fri Jul 24 22:12:53 UTC 2015\r\n422 [main] INFO com.thoughtworks.go.util.PerfTimer  - Performance: Downloading new admin/agent-plugins.zip with md5 signature: 20eaad1f2e9f649dfbff3dbdc5b4afae took 36ms\r\n426 [main] INFO com.thoughtworks.go.agent.AgentProcessParentImpl  - Launching Agent with command: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85.x86_64/jre/bin/java -Dcruise.console.publish.interval=10 -Xms128m -Xmx256m -Dagent.launcher.version=15.1.0 -Dagent.plugins.md5=20eaad1f2e9f649dfbff3dbdc5b4afae -Dagent.binary.md5=WrfXrfz5zYtW7MeCdAotvg== -Dagent.launcher.md5=2SJZgbpIe30D+DTnq691bA== -jar agent.jar https://123.45.67.89:8154/go/\r\n```\r\n\r\n**Tail of `/var/log/go-agent-launcher.log`:**\r\n\r\n```\r\n2015-07-24 22:12:52,911 [TouchLoopThread-2] INFO  go.agent.launcher.Lockfile:102 - Using lock file: /var/lib/go-agent/.agent-bootstrapper.running\r\n2015-07-24 22:12:53,181 [main     ] INFO  agent.common.util.JarUtil:68 - Attempting to load Go-Agent-Bootstrap-Class from agent.jar File:\r\n2015-07-24 22:12:53,182 [main     ] INFO  agent.common.util.JarUtil:83 - manifestClassKey: Go-Agent-Bootstrap-Class: com.thoughtworks.go.agent.AgentProcessParentImpl\r\n2015-07-24 22:12:53,184 [main     ] INFO  thoughtworks.go.agent.AgentProcessParentImpl:49 - Agent is version: 15.1.0\r\n2015-07-24 22:12:53,302 [main     ] INFO  go.agent.launcher.ServerBinaryDownloader:175 - download started at Fri Jul 24 22:12:53 UTC 2015\r\n2015-07-24 22:12:53,307 [main     ] INFO  go.agent.launcher.ServerBinaryDownloader:181 - got server response at Fri Jul 24 22:12:53 UTC 2015\r\n2015-07-24 22:12:53,332 [main     ] INFO  go.agent.launcher.ServerBinaryDownloader:184 - pipe the stream to admin/agent-plugins.zip at Fri Jul 24 22:12:53 UTC 2015\r\n2015-07-24 22:12:53,333 [main     ] INFO  thoughtworks.go.util.PerfTimer:53 - Performance: Downloading new admin/agent-plugins.zip with md5 signature: 20eaad1f2e9f649dfbff3dbdc5b4afae took 36ms\r\n2015-07-24 22:12:53,337 [main     ] INFO  thoughtworks.go.agent.AgentProcessParentImpl:60 - Launching Agent with command: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85.x86_64/jre/bin/java -Dcruise.console.publish.interval=10 -Xms128m -Xmx256m -Dagent.launcher.version=15.1.0 -Dagent.plugins.md5=20eaad1f2e9f649dfbff3dbdc5b4afae -Dagent.binary.md5=WrfXrfz5zYtW7MeCdAotvg== -Dagent.launcher.md5=2SJZgbpIe30D+DTnq691bA== -jar agent.jar https://123.45.67.89:8154/go/\r\n```\r\n\r\n**Tail of `/var/log/go-agent.log`:**\r\n\r\n```\r\n...\r\n2015-07-24 22:39:57,749 [loopThread] ERROR go.agent.service.AgentUpgradeService:64 - [Agent Upgrade] Couldn't connect to: https://123.45.67.89:8154/go/admin/latest-agent.status: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\r\n2015-07-24 22:39:57,750 [loopThread] ERROR thoughtworks.go.agent.AgentController:145 - [Agent Loop] Error occurred during loop:\r\njavax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake\r\n\tat sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:965)\r\n\tat sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)\r\n\tat sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:721)\r\n\tat sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)\r\n\tat java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)\r\n\tat java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)\r\n\tat org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:827)\r\n\tat org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.flushRequestOutputStream(MultiThreadedHttpConnectionManager.java:1525)\r\n\tat org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1975)\r\n\tat org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)\r\n\tat org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)\r\n\tat org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)\r\n\tat org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)\r\n\tat org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)\r\n\tat com.thoughtworks.go.agent.service.AgentUpgradeService.checkForUpgrade(AgentUpgradeService.java:54)\r\n\tat com.thoughtworks.go.agent.service.AgentUpgradeService.checkForUpgrade(AgentUpgradeService.java:47)\r\n\tat com.thoughtworks.go.agent.AgentController.loop(AgentController.java:129)\r\n\tat sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)\r\n\tat org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65)\r\n\tat org.springframework.scheduling.timer.DelegatingTimerTask.run(DelegatingTimerTask.java:70)\r\n\tat java.util.TimerThread.mainLoop(Timer.java:555)\r\n\tat java.util.TimerThread.run(Timer.java:505)\r\nCaused by: java.io.EOFException: SSL peer shut down incorrectly\r\n\tat sun.security.ssl.InputRecord.read(InputRecord.java:482)\r\n\tat sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)\r\n\t... 24 more\r\n```"},"comment":{"url":"https://api.github.com/repos/gocd/gocd/issues/comments/168679776","html_url":"https://github.com/gocd/gocd/issues/1381#issuecomment-168679776","issue_url":"https://api.github.com/repos/gocd/gocd/issues/1381","id":168679776,"user":{"login":"zhmocean","id":2178025,"avatar_url":"https://avatars.githubusercontent.com/u/2178025?v=3","gravatar_id":"","url":"https://api.github.com/users/zhmocean","html_url":"https://github.com/zhmocean","followers_url":"https://api.github.com/users/zhmocean/followers","following_url":"https://api.github.com/users/zhmocean/following{/other_user}","gists_url":"https://api.github.com/users/zhmocean/gists{/gist_id}","starred_url":"https://api.github.com/users/zhmocean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhmocean/subscriptions","organizations_url":"https://api.github.com/users/zhmocean/orgs","repos_url":"https://api.github.com/users/zhmocean/repos","events_url":"https://api.github.com/users/zhmocean/events{/privacy}","received_events_url":"https://api.github.com/users/zhmocean/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T13:48:22Z","updated_at":"2016-01-04T13:48:22Z","body":"```\r\n2016-01-04 21:30:38,014 [loopThread] INFO  apache.commons.httpclient.HttpMethodDirector:444 - Retrying request\r\n2016-01-04 21:30:38,085 [loopThread] ERROR go.agent.service.AgentUpgradeService:64 - [Agent Upgrade] Couldn't connect to: https://10.130.130.81:8154/go/admin/latest-agent.status: javax.net.ssl.SSLException: java.security.ProviderException: java.security.KeyException\r\n2016-01-04 21:30:38,086 [loopThread] ERROR thoughtworks.go.agent.AgentController:164 - There has been a problem with one of Go's SSL certificates. This can be caused by a man-in-the-middle attack, or by pointing the agent to a new server, or by deleting and re-installing Go Server. Go will ask for a new certificate. If this fails to solve the problem, try deleting config/trust.jks in Go Agent's home directory.\r\njavax.net.ssl.SSLException: java.security.ProviderException: java.security.KeyException\r\n```\r\n\r\nI have the connect error with agent at CentOS 6.5 to server at Ubuntu 12(both openjdk-1.7.0_91), even clear all of agent data.\r\nBut have no error at Ubuntu 12(agent) to Ubuntu 12(server) , both openjdk-1.7.0_91 too.\r\nAny SSL issue with different OS?\r\nAgent and server both 15.3.1-2777.\r\nthx\r\n"}}