[asio] Using ASIO to connect to https: using client certificate

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[asio] Using ASIO to connect to https: using client certificate

Boost - Users mailing list

I want to do a simple C++ web get, similar to what is done by this curl command. I must use boost 1.49

curl https://mysite.dev -k --cert C:\work\testCert.pem

The server is requiring the client certificate.

I started by using this example http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/example/ssl/client.cpp

and I added modifications by adding calls to the context like

ctx.set_verify_mode(boost::asio::ssl::verify_peer);
ctx.set_options(boost::asio::ssl::context::default_workarounds);
ctx.use_certificate_file("C:\\work\\testCert.pem", boost::asio::ssl::context_base::pem);
ctx.use_private_key_file("C:\\work\\testKey.pem", boost::asio::ssl::context_base::pem);

but I keep getting messages like 

Connect failed: No connection could be made because the target machine actively refused it

Any help or direction would be very appreciated,


Thanks,

Jim


_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Loading...