title: Jenkins CLI connection refused
body: <p>When executing</p>
  
  <pre><code>java -jar jenkins-cli.jar -s https://jenkins_url help
  </code></pre>
  
  <p>I'm getting connection refused for some reason. Jenkins version is 1580.3, user has the permissions on Jenkins server, cli jar is up-to-date and ssh public key is configured properly. Any idea what might be causing this? Here's the stack trace if it will help:</p>
  
  <pre><code>Exception in thread "main" java.net.ConnectException: Connection refused
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at hudson.cli.CLI.connectViaCliPort(CLI.java:203)
  at hudson.cli.CLI.&lt;init&gt;(CLI.java:126)
  at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
  at hudson.cli.CLI._main(CLI.java:466)
  at hudson.cli.CLI.main(CLI.java:382)
  Suppressed: java.io.EOFException: unexpected stream termination
  at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:331)
  at hudson.remoting.Channel.&lt;init&gt;(Channel.java:421)
  at hudson.remoting.Channel.&lt;init&gt;(Channel.java:400)
  at hudson.remoting.Channel.&lt;init&gt;(Channel.java:396)
  at hudson.remoting.Channel.&lt;init&gt;(Channel.java:385)
  at hudson.remoting.Channel.&lt;init&gt;(Channel.java:377)
  at hudson.remoting.Channel.&lt;init&gt;(Channel.java:353)
  at hudson.cli.CLI.connectViaHttp(CLI.java:157)
  at hudson.cli.CLI.&lt;init&gt;(CLI.java:130)
  ... 3 more
  </code></pre>