Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1194690

Summary: CLI doesn't work when agent-server communication uses sslsocket
Product: [JBoss] JBoss Operations Network Reporter: dsteigne
Component: CLIAssignee: Libor Zoubek <lzoubek>
Status: CLOSED ERRATA QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: JON 3.3.0CC: fbrychta, lzoubek, miburman, mmahoney, theute
Target Milestone: ER01Keywords: Triaged
Target Release: JON 3.3.2   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-30 16:10:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dsteigne 2015-02-20 14:42:52 UTC
Description of problem:
CLI cannot connect to the JON server when it is configured to use agent-server communication over sslsocket.

The solution provided here: https://access.redhat.com/solutions/793503 
does NOT work for JON3.3.0

/jon/cli/bin/rhq-cli.sh -u rhqadmin -p rhqadmin -s 127.0.0.1 -t 55555 --transport sslsocket
Invalid transport [sslsocket], should be either http or https

Version-Release number of selected component (if applicable):
3.3.0

How reproducible:
Always

Steps to Reproduce:
1. Configure JBoss ON Server to use sslsocket and designate a port
rhq.communications.connector.transport=sslsocket
  rhq.communications.connector.bind-port=55555    
2. Try to connect via rhq-cli
rhq-cli.sh -u rhqadmin -p rhqadmin -s 127.0.0.1 -t 55555 --transport sslsocket


Actual results:
Error message:
Invalid transport [sslsocket], should be either http or https

Expected results:
Connect to the JBoss ON server as it did in version 3.2

Additional info:
unconnected$ login --help
Usage: login username password [host]|[host port]|[host port <http>|<https>]
Log into a server with the specified username and password. The server host name and port may optionally be specified. The host name defaults to localhost and the port to 7080. You may also specify the transport to use when communicating with the server; it must be one of 'servlet' or 'sslservlet'.

So the help + error messages says you need to use <http>|<https> .... and the sentence below says you need to use 'servlet' or 'sslservlet'

Then, the code:

RHQ/​ modules/​ enterprise/​ remoting/​ cli/​ src/​ main/​ java/​ org/​ rhq/​ enterprise/​ client/​ commands/​ LoginCommand.java

083         if (args.length > argIndex) {
084             transport = args[argIndex];
085             if (!"http".equals(transport) || !"https".equals(transport)) {
086                 printWriter.println("Invalid transport [" + transport + "], should be either http or https");
087                 return true;
088             }

So regardless what you specify:  http, https, servlet, sslservlet or pigeons.... nothing gets accepted.

I did follow the rest of the code, and socket/sslsocket is not support but that is no real issue here. The agents can still use sockets to communicate; it's just that the CLI must have access to the http(s) port and uses (ssl)servlet.

Comment 1 Libor Zoubek 2015-03-17 17:04:35 UTC
in master

commit:  37310acccfe0e0ed588729a9ec751072bc16247d
author:  Libor Zoubek - lzoubek
message: Bug 1194690 - CLI doesn't work when agent-server communication uses 
         sslsocket

         Update LoginCommand so transport can be specified as one of
         [http, https, socket, sslsocket].

Comment 2 Michael Burman 2015-04-02 11:48:15 UTC
Cherry-picked to jon3.3.x:

commit 2d0895d8bde67f6125c9abba8e67f0aabd326634
Author: Libor Zoubek <lzoubek>
Date:   Tue Mar 17 17:49:31 2015 +0100

    Bug 1194690 - CLI doesn't work when agent-server communication uses
    sslsocket
    
    Update LoginCommand so transport can be specified as one of [http, https,
    socket, sslsocket].
    
    (cherry picked from commit 37310acccfe0e0ed588729a9ec751072bc16247d)

Comment 3 Simeon Pinder 2015-04-13 04:14:40 UTC
Moving to ON_QA for testing with latest cumulative patch build:
https://brewweb.devel.redhat.com//buildinfo?buildID=429507

Note: Build maps to JON 3.3.2 ER01 build.

Comment 7 errata-xmlrpc 2015-04-30 16:10:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0920.html