wsclient to https with anonymous authentication

jack.microsabio.com's picture
I'm trying to use wsclient (from the 2.0.0 source build) to consume a simple service supplied by an https server that does not require any client authentication, but cannot get beyond the "server certificate not found" error. Here's my command line: $ ../bin/wsclient --action=GetEvents/getevents \ --server-cert=/vm/test/wscol.cert \ https://wscol.sky.it/wsxbus/ws/GetEvents < skyit.qry wscol.cert is the server's cert which I retrieved via: echo | openssl s_client -connect wscol.sky.it:443 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > wscol.cert I am able to do a similar thing using the GnuTLS (gnutls-cli) generic client with anonymous authentication, so I know the server supports it. I did build wsf/c with the --enable-openssl option, and I can execute the rampartc/sec_echo sample, so SSL appears to be operational. The wsclient.log file shows: [info] [rampart][rampart_mod] rampart_mod initialized [info] [rahas]Rahas module initialized [error] stub.c(1005) [wsclient] server certificate not found I know it sees the wscol.cert file, because if I change the name, it complains about a file not found. But I don't know whether the "server certificate not found" is relating to an issue with its contents, or some other configuration issue. As a related question, is there a wsclient option to skip authenticating the server's cert? Partially related question: how does one sign up for your online training courses? I see course descriptions and prices, but don't see any option to register, purchase, sign up, etc. (I've also tried contacting the company to purchase one of the described support options (e.g. quickstart support), but never received any response. Thanks in advance, Jack
damitha's picture

Try with space instead of

Try with space instead of equal sign. It should work. ../bin/wsclient --action GetEvents/getevents \ --server-cert /vm/test/wscol.cert \ https://wscol.sky.it/wsxbus/ws/GetEvents < skyit.qry I tried the following in my setup and it workd ./wsclient --no-wsa --soap --no-mtom --server-cert /axis2c/deploywsfc/samples/bin/client_cert.pem < ../samples/bin/wsclient/data/echo.xml https://localhost:443/axis2/services/echo
jack.microsabio.com's picture

client certificate chain file not specified

Thanks for the tip. I think the confusion over using "=" vs. space resulted from the wsclient documentation supplied in the WIN32 binary release, with does use "=". In any case, removing the "=" results in the following error (in the wsclient.log): [info] [rampart][rampart_mod] rampart_mod initialized [info] [rahas]Rahas module initialized [info] Starting addressing out handler [info] [ssl client] Client certificate chain filenot specified [error] http_client.c(645) Content-Type header missing in HTTP response [error] http_client.c(646) Response does not contain Content-Type [error] http_sender.c(1202) status_code < 0 [error] engine.c(171) Transport sender invoke failed New command line: ../bin/wsclient --soap --no-wsa --no-mtom --action GetEvents/getevents \ --server-cert /vm/test/wscol.cert \ https://wscol.sky.it/wsxbus/ws/GetEvents < skyit.qry (Note that no output was received at all so the first two [error] messages appear to be slightly misleading.) Is the "client certificate chain filenot specified" error because it doesn't like my wscol.cert file? (I created it using the openssl procedure outlined at http://phpwebservices.blogspot.com/2008/03/calling-https-service-with-wsclient.html ). Or because it didn't process the command line argument at all? Or because it wants me to specify a --certificate parameter (even though for this server, none should be required). Thanks in advance for any further ideas, Jack
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
KeellsSuper is a leading supermarket chain with 50-plus outlets in Sri Lanka, and it offers the only online supermarket in the country. In 2005, JKH implemented SAP ERP across it’s 70 subsidiaries...
Thursday, February 16th 2012, 09.00 AM (PST)

Thursday, February 16th 2012, 10.00 AM (GMT)