Improved comments on public functions and variables as suggested in https://github.com/openjournals/joss-reviews/issues/1592#issuecomment-514946444
This commit is contained in:
parent
5d89bbcd0f
commit
ed46b43fa7
7 changed files with 130 additions and 57 deletions
|
|
@ -15,11 +15,20 @@ namespace SimpleWeb {
|
|||
template <>
|
||||
class Client<HTTPS> : public ClientBase<HTTPS> {
|
||||
public:
|
||||
Client(const std::string &server_port_path, bool verify_certificate = true, const std::string &cert_file = std::string(),
|
||||
/**
|
||||
* Constructs a client object.
|
||||
*
|
||||
* @param server_port_path Server resource given by host[:port][/path]
|
||||
* @param verify_certificate Set to true (default) to verify the server's certificate and hostname according to RFC 2818.
|
||||
* @param certification_file If non-empty, sends the given certification file to server. Requires private_key_file.
|
||||
* @param private_key_file If non-empty, specifies the file containing the private key for certification_file. Requires certification_file.
|
||||
* @param verify_file If non-empty, use this certificate authority file to perform verification.
|
||||
*/
|
||||
Client(const std::string &server_port_path, bool verify_certificate = true, const std::string &certification_file = std::string(),
|
||||
const std::string &private_key_file = std::string(), const std::string &verify_file = std::string())
|
||||
: ClientBase<HTTPS>::ClientBase(server_port_path, 443), context(asio::ssl::context::tlsv12) {
|
||||
if(cert_file.size() > 0 && private_key_file.size() > 0) {
|
||||
context.use_certificate_chain_file(cert_file);
|
||||
if(certification_file.size() > 0 && private_key_file.size() > 0) {
|
||||
context.use_certificate_chain_file(certification_file);
|
||||
context.use_private_key_file(private_key_file, asio::ssl::context::pem);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue