![]() |
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 39 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 49 of file SocketClient.hpp.
|
inlineprivate |
Adds root certificates from the system to the SSL context.
On Windows, this method loads certificates from the system ROOT store. On Unix-like systems, it uses OpenSSL default verify paths.
Definition at line 94 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 129 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 216 of file SocketClient.hpp.
|
protected |
Definition at line 122 of file SocketClient.hpp.