You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Kyle <kh...@gmail.com> on 2013/04/15 06:45:21 UTC

SSL option

In java 0.20 version of AMQP.

When enable SSL option, I just wonder why AMPQ does not support
keystore_path, truststore_path, keystore_password and truststore_password in
Connection URL? I don't want to configure these parameters as environment
variables by setting javax.net.ssl.keyStore, javax.net.ssl.keyStorePassword,
ect.

How can I do if I want to use SSL with my own KeyStore and TrustStore object
instead of using paths of file system?




--
View this message in context: http://qpid.2158936.n2.nabble.com/SSL-option-tp7591508.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: SSL option

Posted by Kyle <kh...@gmail.com>.
Hi Bill,

As you recommended It worked when I changed from back slashes to forward
slashes.

Thanks for your help.



--
View this message in context: http://qpid.2158936.n2.nabble.com/SSL-option-tp7591508p7591540.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: SSL option

Posted by Bill Freeman <ke...@gmail.com>.
It may be worth trying forward slashes (solidus) inside of the key_store
and truststore arguments, e.g.:

amqp://guest:guest@
/development?brokerlist='tcp://localhost:15771?ssl='true'&key_store='C:/ssl/java_client_keystore.jks'&key_store_password='password'&trust_store='C:/ssl/java_client_truststore.jks'&key_store_password='password''

Windows has traditionally supported either slash at the system call level,
with only the windows command line tools requiring the use of back slash
(reverse solidus) on the command line.

I'm guessing that the error message is saying forward slashes not allowed
but is actually having trouble with the back slashes, since index 88, by my
count, is the "C" of key_store='C:/..., and there's no forward slash there.

Alternatively, since this looks like a URL, url quoting, rather than single
quotes, may be required to quote stuff.  By this I mean that troublesome
characters within the brokerlist argument get replaced by the percent sign
and character code as two hex digits notation.  The primary troublesome
characters visible in your example are ? and &, though this would also help
with the back slashes, so maybe:

amqp://guest:guest@
/development?brokerlist=tcp://localhost:15771%3Fssl=true%26key_store=C:%5Cssl%5Cjava_client_keystore.jks%26key_store_password=password%26trust_store=C:%5Cssl%5Cjava_client_truststore.jks%26key_store_password=password

Since this is actually a URL within a URL, you might possibly need to
further quote the back slashes as %255C (the %25 turns into % on the first
decoding, and the resulting %5C turns into back slash on the second
decoding.

Of course any funky characters in the passwords would have to be quoted.

And did you mean to specify key_store_password twice, or should the second
one be trust_store_password?

Bill


On Mon, Apr 15, 2013 at 4:29 AM, Kyle <kh...@gmail.com> wrote:

> Thank you Keith for your feedback and correction .
>
> When i tried to use broker list options, I got the exception as the bellow:
>
> Virtual host looks like a windows path, forward slash not allowed in URL at
> index 88:
> amqp://guest:guest@
> /development?brokerlist='tcp://localhost:15771?ssl='true'&key_store='C:\ssl\java_client_keystore.jks'&key_store_password='password'&trust_store='C:\ssl\java_client_truststore.jks'&key_store_password='password''
> [Root exception is Virtual host looks like a windows path, forward slash
> not
> allowed in URL between indicies 88 and -57
>
> amqp://guest:guest@/development?brokerlist='tcp://localhost:15771?
>
> ssl='true'&key_store='C:\ssl\java_client_keystore.jks'&key_store_password='password'&trust_store='C:\ssl\java_client_truststore.jks'&key_store_password='password''
>
>
> here is my properties file
>
> .....
>
> connectionfactory.qpidConnectionfactory =
> amqp://guest:guest@
> /development?brokerlist='tcp://localhost:15771?ssl='true'&key_store='C:\\ssl\\java_client_keystore.jks'&key_store_password='password'&trust_store='C:\\ssl\\java_client_truststore.jks'&key_store_password='password''
>
> .....
>
> Any help?
>
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/SSL-option-tp7591508p7591510.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: SSL option

Posted by Kyle <kh...@gmail.com>.
Thank you Keith for your feedback and correction .

When i tried to use broker list options, I got the exception as the bellow:

Virtual host looks like a windows path, forward slash not allowed in URL at
index 88:
amqp://guest:guest@/development?brokerlist='tcp://localhost:15771?ssl='true'&key_store='C:\ssl\java_client_keystore.jks'&key_store_password='password'&trust_store='C:\ssl\java_client_truststore.jks'&key_store_password='password''
[Root exception is Virtual host looks like a windows path, forward slash not
allowed in URL between indicies 88 and -57

amqp://guest:guest@/development?brokerlist='tcp://localhost:15771?
ssl='true'&key_store='C:\ssl\java_client_keystore.jks'&key_store_password='password'&trust_store='C:\ssl\java_client_truststore.jks'&key_store_password='password''


here is my properties file

.....

connectionfactory.qpidConnectionfactory =
amqp://guest:guest@/development?brokerlist='tcp://localhost:15771?ssl='true'&key_store='C:\\ssl\\java_client_keystore.jks'&key_store_password='password'&trust_store='C:\\ssl\\java_client_truststore.jks'&key_store_password='password''

.....

Any help?




--
View this message in context: http://qpid.2158936.n2.nabble.com/SSL-option-tp7591508p7591510.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: SSL option

Posted by Keith W <ke...@gmail.com>.
Hello Kyle

On 15 April 2013 05:45, Kyle <kh...@gmail.com> wrote:
> In java 0.20 version of AMQP.
>
> When enable SSL option, I just wonder why AMPQ does not support
> keystore_path, truststore_path, keystore_password and truststore_password in
> Connection URL?

This is supported already by way of broker list options within the
connection url.  See:

http://qpid.apache.org/books/0.20/Programming-In-Apache-Qpid/html/QpidJNDI.html#section-jms-connection-url

Take care with the quouting of argument values.

> I don't want to configure these parameters as environment
> variables by setting javax.net.ssl.keyStore, javax.net.ssl.keyStorePassword,
> ect.

For clarity, these are JVM system properties rather than OS
environment variables.

>
> How can I do if I want to use SSL with my own KeyStore and TrustStore object
> instead of using paths of file system?

This is not a supported use case. Indeed, the JMS API exposes no
interface in this area apart from the connection url.

HTH,

Keith Wall.

>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/SSL-option-tp7591508.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

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