How do I force verify_peer to accept self signed certs (in 0.12.0 version)

28 views
Skip to first unread message

rsa

unread,
Jul 21, 2017, 7:30:25 AM7/21/17
to The C++ Network Library
 
 In my development environment, my server and client are using self-signed certs.  I would like client to perform
 peer (server) verification when connecting to the server.  Right now, in 0.12, when I set

http::client::options client_options;
  client_options.follow_redirects(true)
  .cache_resolved(true)
  .openssl_certificate_file("/path/to/client/cert")
  .openssl_private_key_file("/path/to/client/key")
  .always_verify_peer(true)
  .openssl_certificate("/path/to/server/cert")
  .timeout(10);
  http::client client(client_options);

This always fails with 'certificate verify failed' error.  How can I set, verify_peer to 'true' and still 
make a successful connection to server.

BTW, when I turn of verify_peer, secure connection to server works fine.

Any help is appreciated.


thanks
rsa 
Reply all
Reply to author
Forward
0 new messages