S3FC project page | S3FC home page |
#include <s3_socket_tcp_ssl.h>
Inheritance diagram for s3_socket_tcp_ssl:
Public Methods | |
s3_socket_tcp_ssl (int newsock=INVALID_SOCKET, bool new_set_reuseaddr=true) | |
Construct a new socket. More... | |
s3_socket_tcp_ssl (const s3_socket_tcp_ssl &template_sock) | |
~s3_socket_tcp_ssl () | |
bool | accept (s3_socket_tcp_ssl &newsock, sockaddr_in *clientname=0) |
Accept a connection on the socket. More... | |
bool | connect (const std::string &IP_address, in_port_t port) |
Connect the socket to addr:port. More... | |
bool | close (bool reinit=true) |
Close the socket. More... | |
std::string | get_error () const |
Returns a string describing the most recent error. More... | |
bool | set_keyfile_password (std::string newkey, std::string newpass) |
bool | set_verify_locations_file (std::string new_CAfile) |
bool | set_verify_locations_path (std::string new_CApath) |
bool | read (void *data, int size, s3_semaphore *term=0) |
Reads data from socket in non-blocking mode, and is guaranteed to wait until all the data (as indicated by size) has been read from the socket. More... | |
bool | write (void *data, int size, int max_packet=-1, s3_semaphore *term=0) |
Writes data to a connect()ed socket, optionally limiting packet size to some reasonable value. More... | |
Static Public Methods | |
int | password_cb (char *buf, int num, int rwflag, void *userdata) |
Protected Methods | |
void | set_errnos (unsigned long new_ssl_error=ERR_LIB_NONE) |
Protected Attributes | |
unsigned long | ssl_error |
SSL_CTX * | ctx |
SSL * | ssl |
std::string | keyfile |
std::string | password |
std::string | CAfile |
std::string | CApath |
Static Protected Attributes | |
bool | ssl_init_done = false |
Private Methods | |
bool | setup_ssl () |
Friends | |
bool | accept (s3_socket_tcp_ssl &newsock, sockaddr_in *clientname) |
|
Construct a new socket.
Definition at line 45 of file s3_socket_tcp_ssl.cc. References ssl_init_done. |
|
Definition at line 61 of file s3_socket_tcp_ssl.cc. |
|
Definition at line 68 of file s3_socket_tcp_ssl.cc. |
|
Accept a connection on the socket.
Definition at line 176 of file s3_socket_tcp_ssl.cc. References s3_socket_tcp::accept, CAfile, CApath, keyfile, password, S3FC_DBG2_, S3FC_DBG_, set_errnos, set_keyfile_password, set_verify_locations_file, set_verify_locations_path, setup_ssl, and ssl. |
|
Close the socket.
Reimplemented from s3_socket_tcp. Definition at line 235 of file s3_socket_tcp_ssl.cc. References s3_socket_tcp::close, S3FC_DBG_, set_errnos, and ssl. Referenced by ~s3_socket_tcp_ssl. |
|
Connect the socket to addr:port.
Reimplemented from s3_socket_tcp. Definition at line 210 of file s3_socket_tcp_ssl.cc. References s3_socket_tcp::connect, S3FC_DBG_, set_errnos, setup_ssl, and ssl. |
|
Returns a string describing the most recent error.
Reimplemented from s3_socket_tcp. Definition at line 254 of file s3_socket_tcp_ssl.cc. References s3_socket_tcp::get_error, S3FC_DBG2_, and ssl_error. |
|
Definition at line 358 of file s3_socket_tcp_ssl.cc. Referenced by setup_ssl. |
|
Reads data from socket in non-blocking mode, and is guaranteed to wait until all the data (as indicated by size) has been read from the socket. It calls s3_thread_base::test_cancel() in the loop to ensure that this call will not block the thread termination process.
Reimplemented from s3_socket_tcp. Definition at line 266 of file s3_socket_tcp_ssl.cc. References S3FC_DBG_, s3_socket_tcp::select_rd, s3_socket_tcp::set_errnos, set_errnos, ssl, s3_thread_base::test_cancel, and s3_semaphore::try_wait. |
|
Definition at line 170 of file s3_socket_tcp_ssl.cc. References s3_socket_tcp::set_errnos, and ssl_error. Referenced by accept, close, connect, read, setup_ssl, and write. |
|
Definition at line 83 of file s3_socket_tcp_ssl.cc. References keyfile, and password. Referenced by accept. |
|
Definition at line 91 of file s3_socket_tcp_ssl.cc. References CAfile. Referenced by accept. |
|
Definition at line 97 of file s3_socket_tcp_ssl.cc. References CApath. Referenced by accept. |
|
Definition at line 103 of file s3_socket_tcp_ssl.cc. References CAfile, CApath, ctx, ERROR_CERT_IN_HASH, keyfile, password, password_cb, S3FC_DBG2_, S3FC_DBG_, set_errnos, s3_socket_tcp::sock, and ssl. |
|
Writes data to a connect()ed socket, optionally limiting packet size to some reasonable value. It calls s3_thread_base::test_cancel() in the loop to ensure that this call will not block the thread termination process.
Reimplemented from s3_socket_tcp. Definition at line 309 of file s3_socket_tcp_ssl.cc. References S3FC_DBG_, s3_socket_tcp::select_wr, s3_socket_tcp::set_errnos, set_errnos, ssl, s3_thread_base::test_cancel, and s3_semaphore::try_wait. |
|
|
|
Definition at line 71 of file s3_socket_tcp_ssl.h. Referenced by accept, set_verify_locations_file, and setup_ssl. |
|
Definition at line 71 of file s3_socket_tcp_ssl.h. Referenced by accept, set_verify_locations_path, and setup_ssl. |
|
Definition at line 69 of file s3_socket_tcp_ssl.h. Referenced by setup_ssl, and ~s3_socket_tcp_ssl. |
|
Definition at line 71 of file s3_socket_tcp_ssl.h. Referenced by accept, set_keyfile_password, and setup_ssl. |
|
Definition at line 71 of file s3_socket_tcp_ssl.h. Referenced by accept, set_keyfile_password, and setup_ssl. |
|
Definition at line 70 of file s3_socket_tcp_ssl.h. Referenced by accept, close, connect, read, setup_ssl, write, and ~s3_socket_tcp_ssl. |
|
Definition at line 68 of file s3_socket_tcp_ssl.h. Referenced by get_error, and set_errnos. |
|
Definition at line 40 of file s3_socket_tcp_ssl.cc. Referenced by s3_socket_tcp_ssl. |
Send comments to: s3fc@stonethree.com |
|