![]() |
Kurlyk
|
A WebSocket client with SSL support. More...
#include <SocketClient.hpp>
Public Member Functions | |
SocketClient (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()) | |
Constructs a WebSocket client with SSL/TLS support. | |
Protected Member Functions | |
void | connect () override |
Initiates the connection process. | |
void | handshake (const std::shared_ptr< Connection > &connection) |
Performs the SSL/TLS handshake. | |
Protected Attributes | |
asio::ssl::context | context |
Private Member Functions | |
void | add_root_certificates () |
Adds root certificates from the system to the SSL context. | |
A WebSocket client with SSL support.
This class extends the SocketClientBase<WSS>
class to provide SSL/TLS support for WebSocket connections. It allows you to connect to a WebSocket server over a secure connection using SSL/TLS. The class also includes functionality to load root certificates from the system to facilitate secure connections.
Definition at line 31 of file SocketClient.hpp.
|
inline |
Constructs a WebSocket client with SSL/TLS support.
server_port_path | Server resource specified by host[:port][/path]. |
verify_certificate | Set to true (default) to enable verification of the server's certificate and hostname according to RFC 2818. |
certification_file | If provided, specifies the file containing the client certificate to use. Requires private_key_file. |
private_key_file | If provided, specifies the file containing the private key corresponding to the client certificate. Requires certification_file. |
verify_file | If provided, specifies a certificate authority file for verification. |
Definition at line 41 of file SocketClient.hpp.
|
inlineprivate |
Adds root certificates from the system to the SSL context.
This method loads root certificates from the system certificate store and adds them to the SSL context. It is used when no specific certificate authority file is provided.
Definition at line 87 of file SocketClient.hpp.
|
inlineoverrideprotected |
Initiates the connection process.
This method starts the process of connecting to the WebSocket server, including resolving the server address and establishing the connection. It handles both direct and proxy connections and performs the necessary SSL/TLS handshake.
Definition at line 119 of file SocketClient.hpp.
|
inlineprotected |
Performs the SSL/TLS handshake.
This method performs the SSL/TLS handshake with the WebSocket server. It sets the server name for SNI and handles the asynchronous handshake process. Once the handshake is complete, it calls the upgrade
method to finalize the connection.
connection | A shared pointer to the connection object. |
Definition at line 206 of file SocketClient.hpp.
|
protected |
Definition at line 112 of file SocketClient.hpp.