You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Andrew Stitcher (Jira)" <ji...@apache.org> on 2022/06/16 17:45:00 UTC

[jira] [Commented] (PROTON-2561) User/Pass connection to ActiveMQ Artemis from Ruby doesn't work

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

Andrew Stitcher commented on PROTON-2561:
-----------------------------------------

I'm not sure if this sort of URL is supported by the Container.new method - it is generally not a good idea to use URLs with embedded passwords in any case - Even an update to the current URL rfc (rfc-3986 3.2.1) says not to do this!

It looks to me that you can supply {{:user}} and {{:password}} options to the connection.open method to achieve what you need in {{{}helloworld.rb{}}}:

{{container.connect(@url, \{:user=>'username', :password=>'pwd-for-username'})}}

 

> User/Pass connection to ActiveMQ Artemis from Ruby doesn't work
> ---------------------------------------------------------------
>
>                 Key: PROTON-2561
>                 URL: https://issues.apache.org/jira/browse/PROTON-2561
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: ruby-binding
>    Affects Versions: proton-c-0.36.0, proton-c-0.37.0
>         Environment: MacOS, Ubuntu
>            Reporter: Alexandr Kovalenko
>            Assignee: Alan Conway
>            Priority: Major
>
> ActiveMQ Artemis 2.22.0
> File {{login.config}} contains:
> {code:java}
> activemq {
>    org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule sufficient
>        debug=false
>        reload=true
>        org.apache.activemq.jaas.properties.user="artemis-users.properties"
>        org.apache.activemq.jaas.properties.role="artemis-roles.properties";
> };{code}
> Ruby {{helloworld.rb}}
> Set user/pass connection in the past line of code
> {code:java}
> Qpid::Proton::Container.new(HelloWorld.new('amqp://artemis:artemis@localhost:5672', 'examples')).run{code}
> The message isn't sent and i see in the Artemis's logs:
> {code:java}
>  2022-06-13 12:07:09,253 WARN  [org.apache.activemq.artemis.core.server] AMQ222216: Security problem while authenticating: AMQ229031: Unable to validate user from /172.19.0.1:59864. Username: null; SSL certificate subject DN: unavailable
> artemis_1  | 2022-06-13 12:07:09,254 WARN  [org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext] AMQ229031: Unable to validate user from /172.19.0.1:59864. Username: null; SSL certificate subject DN: unavailable: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229031: Unable to validate user from /172.19.0.1:59864. Username: null; SSL certificate subject DN: unavailable]{code}
> So Artemis says that it receives username {*}null{*}.
> ----
> If i try to do the same in Python example - it works correct.
> Python {{helloworld.py}}
> Set user/pass connection in the past line of code
> {code:java}
> Container(HelloWorld("amqp://artemis:artemis@localhost:5672", "examples")).run(){code}
> As a result - the message sent and in Artemis's logs all is ok:
> {code:java}
> artemis_1  | 2022-06-13 11:46:30,860 INFO  [org.apache.activemq.artemis.core.server.plugin.impl] AMQ841000: created connection: org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection@151ad103
> artemis_1  | 2022-06-13 11:46:30,970 INFO  [org.apache.activemq.artemis.core.server.plugin.impl] AMQ841010: routed message with ID: 8589934599, result: NO_BINDINGS
> artemis_1  | 2022-06-13 11:46:30,972 INFO  [org.apache.activemq.artemis.core.server.plugin.impl] AMQ841002: created session name: 778f929c-eb0e-11ec-8863-0242ac130002, session connectionID: 933989dd
> artemis_1  | 2022-06-13 11:46:30,990 INFO  [org.apache.activemq.artemis.core.server.plugin.impl] AMQ841010: routed message with ID: 8589934600, result: NO_BINDINGS
> artemis_1  | 2022-06-13 11:46:30,992 INFO  [org.apache.activemq.artemis.core.server.plugin.impl] AMQ841003: closed session with session name: 778f929c-eb0e-11ec-8863-0242ac130002, failed: false
> artemis_1  | 2022-06-13 11:46:30,993 INFO  [org.apache.activemq.artemis.core.server.plugin.impl] AMQ841001: destroyed connection: org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection@151ad103{code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org