Options.SetProperty not working

21 views
Skip to first unread message

sajmplus

unread,
May 3, 2015, 9:58:04 PM5/3/15
to wsf-...@googlegroups.com
Hello,

i'm developing application with help of axis2c-unofficial and staff. I want to load SSL certs and passphrase dynamically but unfortunately staff::Options.SetProperty does not set SERVER_CERT, KEY_FILE and SSL_PASSPHRASE. Here is my code (works like a charm when using certs from axis2.xml):


#include <staff/utils/Log.h>

#include <staff/common/logoperators.h>

#include <staff/client/Options.h>

#include <staff/common/Exception.h>

#include <staff/client/ServiceClient.h>

#include <staff/common/DataObject.h>

#include <iostream>







int main(int /*nArgs*/, const char* /*paszArgs*/[])

{

  try

  {

        staff::ServiceClient tClient;



        tClient.Init("https://...");

        staff::Options &tOptions = tClient.GetOptions();



        tOptions.SetProperty("SERVER_CERT", "C:\\ws\\server.pem");

        tOptions.SetProperty("KEY_FILE","C:\\ws\\client.pem");

        tOptions.SetProperty("SSL_PASSPHRASE","...");



        staff::DataObject tdoPayLoad("Echo");

        tdoPayLoad.DeclareNamespace("https://...","");

        tdoPayLoad.CreateChild("message","Echo");



        std::cout << "Request: \n---\n" << tdoPayLoad.ToString();



        staff::DataObject result = tClient.Invoke(tdoPayLoad);



        std::cout << "Response: \n---\n" << result.ToString() << std::endl;



        std::string resultString = "";



        result.GetChildValueByLocalName("EchoResult",resultString);



        std::cout <<"Result: "<< resultString;

  }

  STAFF_CATCH_ALL



  return 0;

}



Logfile:

[Mon May 04 03:57:09 2015] [error] ssl/ssl_utils.c(51) Cannot find certificates
[Mon May 04 03:57:09 2015] [error] ssl/ssl_stream.c(101) Error occurred in SSL engine
[Mon May 04 03:57:09 2015] [error] http_client.c(298) Data stream creation failed for Host ... and 443 port
[Mon May 04 03:57:09 2015] [error] http_client.c(555) client data stream  null or socket error for host ... and 443 port
[Mon May 04 03:57:09 2015] [error] http_client.c(559) A read attempt(HTTP) for the reply without sending the request
[Mon May 04 03:57:09 2015] [error] http_sender.c(1402) status_code < 0
[Mon May 04 03:57:09 2015] [error] engine.c(179) Transport sender invoke failed




sajmplus

unread,
May 13, 2015, 5:58:39 PM5/13/15
to wsf-...@googlegroups.com
Is there any option to do something with that?

Dmitry Utkin

unread,
May 14, 2015, 4:55:12 AM5/14/15
to wsf-...@googlegroups.com, simpl...@gmail.com
I'm not sure,


четверг, 14 мая 2015 г., 0:58:39 UTC+3 пользователь sajmplus написал:
Reply all
Reply to author
Forward
0 new messages