Hi Ken,

The complete code is adapted from the send.c code from the examples on the  web.
The indented section has been added by myself.
                                pn_message_t * message;
                                pn_messenger_t * messenger;
                                pn_data_t * body;

                                message = pn_message();
                                messenger = pn_messenger(NULL);

                                pn_messenger_start(messenger);
                                pn_message_set_address(message, address);
                                                pn_messenger_set_private_key( 
messenger, "<USER_NAME>" );
                                                
pn_messenger_set_certificate(messenger, "<USER_NAME>");
                                                
pn_messenger_set_trusted_certificates(messenger, "<USER_NAME>");
                                body = pn_message_body(message);
                                pn_data_put_string(body, 
pn_bytes(strlen(msgtext), msgtext));
                                pn_messenger_put(messenger, message);
                                check(messenger);
                                pn_messenger_send(messenger, -1);
                                check(messenger);

                                pn_messenger_stop(messenger);
                                pn_messenger_free(messenger);
                                pn_message_free(message);
                                pn_ssl_domain_free( sslDomain );

The code fails and prints "CONNECTION ERROR invalid credentials"
When I step through the debugger, I can see that this is failing due to 
pn_ssl_domain_set_credentials returning -1 in pn_transport_config.
This is what makes me think that I do not have the Open SSL setup correctly.

I will try the test client first though as it looks like it will be quicker to 
test with.

Regards,

TLS


From: Ken Giusti [via Qpid] [mailto:[email protected]]
Sent: 27 May 2014 15:00
To: Mark Sheedy
Subject: Re: Help connecting with SSL

Hi,

----- Original Message -----

> From: "TheLoneStranger" <[hidden 
> email]</user/SendEmail.jtp?type=node&node=7608656&i=0>>
> To: [hidden email]</user/SendEmail.jtp?type=node&node=7608656&i=1>
> Sent: Tuesday, May 27, 2014 6:37:02 AM
> Subject: Help connecting with SSL
>
> Hello,
>
> I have written a C++ test client which connects to a C# server.
> The server is configured with Microsoft Service Bus and Active directory.
> The connection parameters I have are below..
>
> Endpoint=sb://<MACHINE_NAME>/PerfTest;StsEndpoint=https://<MACHINE_NAME>:9355/PerfTest;RuntimePort=5671;ManagementPort=9355;TransportType=Amqp
>
> I have downloaded the send.c example from the website, but this does not
> have the SSL configuration.
> (http://qpid.apache.org/releases/qpid-proton-0.5/messenger/c/examples/)
>
> I know the certificate setup is correct as I have a C# client working on the
> machine.
>
> So far in the code for the test client, I have added calls to the following
> certificate API's
> pn_messenger_set_private_key
> pn_messenger_set_certificate
> pn_messenger_set_trusted_certificates
>


Can you post your code that sets up SSL?


> However, the code is always failing in messenger.c:pn_transport_config.
>


Can you post output of the failure - what error(s) are you getting.


> I can see that I need to configure the SSL calls, but I cannot work this out
> from the documentation.
>


There's test Messenger clients written in C that you can use to test out SSL.  
These are the msgr-send and msgr-recv clients (in the tests/tools/apps/c 
directory of the source repo).

If you want your client to authenticate the server, you'll need to provide the 
CA database (a PEM file) via the -T option.  Optionally, if you want the server 
to authenticate the client, you'll also have to provide the client's 
self-identifying certificate (also a PEM file) via the -C option, the private 
key used to sign the client's self-identifying certificate (PEM file) if not 
already present in the certificate itself.  Finally, you'll need to provide the 
password used to unlock the client's certificate (via the -P argument).

Also - although it is written in Python - there is a test that checks SSL 
authentication in the tests/python/proton_tests/ssl.py file.  You may also want 
to see the README.txt file in tests/proton/python_tests/ssl_db for details 
regarding how to configure your certs.

> Any help would be much appreciated.
>
> TheLoneStranger
>
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Help-connecting-with-SSL-tp7608636.html
> Sent from the Apache Qpid Proton mailing list archive at Nabble.com.
>

--
-K

________________________________
If you reply to this email, your message will be added to the discussion below:
http://qpid.2158936.n2.nabble.com/Help-connecting-with-SSL-tp7608636p7608656.html
To unsubscribe from Help connecting with SSL, click 
here<http://qpid.2158936.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7608636&code=bWFyay5zaGVlZHlAZWRmdHJhZGluZy5jb218NzYwODYzNnw0ODg0NTc0MDI=>.
NAML<http://qpid.2158936.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

________________________________
This e-mail may contain information that is confidential, privileged or 
otherwise protected from disclosure. If you are not an intended recipient of 
this e-mail, do not duplicate or redistribute it by any means. Please delete it 
and any attachments and notify the sender that you have received it in error. 
Unless specifically indicated, this e-mail is not an offer to buy or sell or a 
solicitation to buy or sell any commodities, financial risk management 
products, or other physical or financial product or service, an official 
confirmation of any transaction, or an official statement of EDF Trading 
Limited, EDF Trading Markets Limited, EDF Trading North America, LLC, or any of 
the EDF Group family of companies. Any views or opinions presented are solely 
those of the author and do not necessarily represent those of the foregoing 
entities. EDF Trading Markets Limited is authorised and regulated by the 
Financial Conduct Authority. VAT number: GB 735 5479 07. EDF Trading Markets 
Limited and EDF Trading North America, LLC are members of the EDF Group of 
companies. EDF Trading Markets Limited maintains its registered office at 80 
Victoria Street, 3rd Floor, Cardinal Place, London, SW1E 5JL. A Company 
registered in England No. 4255974. EDF Trading North America, LLC is 
headquartered in the United States at 4700 W. Sam Houston Pkwy., Suite 250, 
Houston, TX 77041





--
View this message in context: 
http://qpid.2158936.n2.nabble.com/Help-connecting-with-SSL-tp7608636p7608659.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Reply via email to