Thomas Kettenbach created PROTON-2329:
-----------------------------------------

             Summary: Incorrect handling of commandline options in ssl.cpp
                 Key: PROTON-2329
                 URL: https://issues.apache.org/jira/browse/PROTON-2329
             Project: Qpid Proton
          Issue Type: Bug
          Components: examples
            Reporter: Thomas Kettenbach


I've prepared the following PR for this: 
[https://github.com/apache/qpid-proton/pull/291]

This Jira Ticket shall provide background infos, concerning this.

 

The ssl.cpp example handles command line arguments in an incorrect way.

The argument passed to '-c' options must not end with '/' (as some shells 
automatically append when pressing <tab> to expand the directory name), else it 
will fall back to 'ssl-certs/'

 

Below I'm assuming build artefacts in 'build/' subdirectory, eg.

    mkdir build && cd build && cmake .. && make && cd ../cpp/examples

Examples of the wrong behariour

    $ ../../build/cpp/examples/ssl -c newdir/
    Inbound server connection connected via SSL. Protocol: TLSv1/SSLv3
    Outgoing client connection connected via SSL. Server certificate identity 
CN=test_server
    Hello World!

Expected behaviour would be to pick 'tserver','tclient' certificate files from 
directory 'newdir'

 

I don't provide correct files in the 'newdir', just to demonstrate, that the 
certificate files would be looked up in the 'newdir', so when omitting '/', the 
correct directory is picked:

    $ ../../build/cpp/examples/ssl -c newdir
    SSL certificate initialization failure for 
newdir/tserver-certificate.pem:newdir/tserver-private-key.pem:tserverpw

 

Also, when passing an unknown command line option, the usage should be printed.

    ../../build/cpp/examples/ssl -j
    unknown option -j


     ../../build/cpp/examples/ssl -h

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to