[ 
https://issues.apache.org/jira/browse/AMQ-4433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13810010#comment-13810010
 ] 

Claus Ibsen commented on AMQ-4433:
----------------------------------

There is a number of tests that fail now, its maybe because they had extra 
options not in use. Just pasting it here so its not lost

{code}
Tests in error:
  testOpenwireSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test): 
Error creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testOpenwireSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test)
  testOpenwireSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test): Error 
creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testOpenwireSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test)
  testJmx(org.apache.activemq.bugs.AMQ4126Test): Error creating bean with name 
'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testJmx(org.apache.activemq.bugs.AMQ4126Test)
  testStompSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test): 
Error creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testStompSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test)
  testStompNIOSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test): 
Error creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testStompNIOSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test)
  
testOpenwireNIOSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test):
 Error creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  
testOpenwireNIOSSLWithUsernameAndPassword(org.apache.activemq.bugs.AMQ4126Test)
  testOpenwireNIOSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test): 
Error creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testOpenwireNIOSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test)
  testStompNIOSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test): Error 
creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testStompNIOSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test)
  testStompSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test): Error 
creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/JaasStompSSLBroker.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Transport Connector could not be registered in JMX: Failed to bind to server 
socket: stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  testStompSSLWithCertificate(org.apache.activemq.bugs.AMQ4126Test)
  stompSSLNeedClientAuthTrue(org.apache.activemq.bugs.AMQ4133Test): Error 
creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/InconsistentConnectorPropertiesBehaviour.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Failed to bind to server socket: 
stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  stompSSLTransportNeedClientAuthTrue(org.apache.activemq.bugs.AMQ4133Test): 
Error creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/InconsistentConnectorPropertiesBehaviour.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Failed to bind to server socket: 
stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  stompNIOSSLNeedClientAuthTrue(org.apache.activemq.bugs.AMQ4133Test): Error 
creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/InconsistentConnectorPropertiesBehaviour.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Failed to bind to server socket: 
stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  stompNIOSSLTransportNeedClientAuthTrue(org.apache.activemq.bugs.AMQ4133Test): 
Error creating bean with name 'broker' defined in file 
[/Users/davsclaus/workspace/activemq/activemq-unit-tests/src/test/resources/org/apache/activemq/bugs/amq4126/InconsistentConnectorPropertiesBehaviour.xml]:
 Invocation of init method failed; nested exception is java.io.IOException: 
Failed to bind to server socket: 
stomp+nio+ssl://0.0.0.0:0?transport.needClientAuth=true due to: 
java.net.SocketException: Invalid transport connector parameters: 
{needClientAuth=true}
  org.apache.activemq.transport.failover.FailoverBackupLeakTest: Failed to bind 
to server socket: tcp://0.0.0.0:0?transport.closeAsync=false due to: 
java.net.SocketException: Invalid transport connector parameters: 
{closeAsync=false}
{code}

> Socket parameters are not validated
> -----------------------------------
>
>                 Key: AMQ-4433
>                 URL: https://issues.apache.org/jira/browse/AMQ-4433
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Transport
>            Reporter: Christoffer Sawicki
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.10.0
>
>         Attachments: 0001-Validate-socket-parameters.patch, 
> 0002-Validate-connector-parameters.patch, 
> 0003-Validate-transport-parameters.patch
>
>
> Connect parameters are validated in every transport factory with a statement 
> like this:
> {noformat}
> if (!options.isEmpty()) {
>   throw new IllegalArgumentException("Invalid connect parameters: " + 
> options);
> }
> {noformat}
> Socket parameters (i.e. connect parameters prefixed with {{socket.}}) are 
> however never validated.
> They are put away at
> {noformat}
> TcpTransportFactory.compositeConfigure(Transport, WireFormat, Map) line: 85   
> {noformat}
> and then set at
> {noformat}
> TcpTransport.initialiseSocket(Socket) line: 428
> {noformat}
> where there is no check that {{socketOptions}} is empty after the call.
> I've attached a patch (#1) that rectifies this.
> Bonus: I found similar issues in the transport classes. See patch #2 and #3.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to