You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
544 B
C++
24 lines
544 B
C++
#include "webcc/ssl_client.h"
|
|
|
|
#include "boost/algorithm/string.hpp"
|
|
|
|
#include "webcc/ssl_socket.h"
|
|
|
|
namespace webcc {
|
|
|
|
SslClient::SslClient(boost::asio::io_context& io_context,
|
|
boost::asio::ssl::context& ssl_context)
|
|
: Client(io_context), ssl_context_(ssl_context) {
|
|
}
|
|
|
|
void SslClient::AsyncConnect() {
|
|
if (boost::iequals(request_->url().scheme(), "https")) {
|
|
socket_.reset(new SslSocket{ io_context_, ssl_context_ });
|
|
AsyncResolve("443");
|
|
} else {
|
|
Client::AsyncConnect();
|
|
}
|
|
}
|
|
|
|
} // namespace webcc
|